CIRCUIT DIAGRAM
PROPELLER SIDE
MOTOR SPEED CONTROL
PROGRAM
void setup()
{
pinMode(P2_0,OUTPUT); //declare all pins as output
pinMode(P2_1,OUTPUT);
pinMode(P2_2,OUTPUT);
pinMode(P2_3,OUTPUT);
pinMode(P2_4,OUTPUT);
pinMode(P2_5,OUTPUT);
pinMode(P2_6,OUTPUT);
pinMode(P2_7,OUTPUT);
}
void loop()
{
letterC();
}
void letterC(void)// C
{
digitalWrite(P2_0,LOW); //1st segment
digitalWrite(P2_1,LOW);
digitalWrite(P2_2,HIGH);
digitalWrite(P2_3,HIGH);
digitalWrite(P2_4,HIGH);
digitalWrite(P2_5,HIGH);
digitalWrite(P2_6,LOW);
digitalWrite(P2_7,LOW);
delayMicroseconds(150);
digitalWrite(P2_0,LOW); //2nd segment
digitalWrite(P2_1,HIGH);
digitalWrite(P2_2,HIGH);
digitalWrite(P2_3,HIGH);
digitalWrite(P2_4,HIGH);
digitalWrite(P2_5,HIGH);
digitalWrite(P2_6,HIGH);
digitalWrite(P2_7,LOW);
delayMicroseconds(150);
digitalWrite(P2_0,HIGH); //3rd segment
digitalWrite(P2_1,HIGH);
digitalWrite(P2_2,LOW);
digitalWrite(P2_3,LOW);
digitalWrite(P2_4,LOW);
digitalWrite(P2_5,LOW);
digitalWrite(P2_6,HIGH);
digitalWrite(P2_7,HIGH);
delayMicroseconds(150);
digitalWrite(P2_0,HIGH;//4th segment
digitalWrite(P2_1,HIGH);
digitalWrite(P2_2,LOW);
digitalWrite(P2_3,LOW);
digitalWrite(P2_4,LOW);
digitalWrite(P2_5,LOW);
digitalWrite(P2_6,HIGH);
digitalWrite(P2_7,HIGH);
delayMicroseconds(150);
digitalWrite(P2_0,HIGH); //5th segment
digitalWrite(P2_2,LOW);
digitalWrite(P2_3,LOW);
digitalWrite(P2_4,LOW);
digitalWrite(P2_5,LOW);
digitalWrite(P2_6,HIGH);
digitalWrite(P2_7,HIGH);
delayMicroseconds(150);
digitalWrite(P2_0,LOW); //last segment – off state
digitalWrite(P2_1,LOW);
digitalWrite(P2_2,LOW);
digitalWrite(P2_3,LOW);
digitalWrite(P2_4,LOW);
digitalWrite(P2_5,LOW);
digitalWrite(P2_6,LOW);
digitalWrite(P2_7,LOW);
delayMicroseconds(400);
}