Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char Palavra[] = "PROJETEIROS";
- const int atraso=2000;
- const int P=2;
- const int R=3;
- const int O=4;
- const int J=5;
- const int E=6;
- const int T=7;
- const int I=8;
- const int S=9;
- void setup()
- {
- pinMode(P, OUTPUT);
- pinMode(R, OUTPUT);
- pinMode(O, OUTPUT);
- pinMode(J, OUTPUT);
- pinMode(E, OUTPUT);
- pinMode(T, OUTPUT);
- pinMode(E, OUTPUT);
- pinMode(I, OUTPUT);
- pinMode(R, OUTPUT);
- pinMode(O, OUTPUT);
- pinMode(S, OUTPUT);
- }
- void loop()
- {
- for (int x=0; x<(sizeof(Palavra)-1); x++) {
- switch (Palavra[x]) {
- case 'P': // your hand is on the sensor
- digitalWrite(P,HIGH);
- delay(atraso);
- digitalWrite(P,LOW);
- delay(atraso);
- break;
- case 'R': // your hand is close to the sensor
- digitalWrite(R,HIGH);
- delay(atraso);
- digitalWrite(R,LOW);
- delay(atraso);
- break;
- case 'O': // your hand is close to the sensor
- digitalWrite(O,HIGH);
- delay(atraso);
- digitalWrite(O,LOW);
- delay(atraso);
- break;
- case 'J': // your hand is close to the sensor
- digitalWrite(J,HIGH);
- delay(atraso);
- digitalWrite(J,LOW);
- delay(atraso);
- break;
- case 'E': // your hand is close to the sensor
- digitalWrite(E,HIGH);
- delay(atraso);
- digitalWrite(E,LOW);
- delay(atraso);
- break;
- case 'T': // your hand is close to the sensor
- digitalWrite(T,HIGH);
- delay(atraso);
- digitalWrite(T,LOW);
- delay(atraso);
- break;
- case 'I': // your hand is close to the sensor
- digitalWrite(I,HIGH);
- delay(atraso);
- digitalWrite(I,LOW);
- delay(atraso);
- break;
- case 'S': // your hand is close to the sensor
- digitalWrite(S,HIGH);
- delay(atraso);
- digitalWrite(S,LOW);
- delay(atraso);
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement