Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char letra;
- int luz=13;
- void setup() {
- Serial.begin(9600);
- Serial.print("Iniciando comunicacao serial\n");
- pinMode(luz,OUTPUT);
- }
- void loop() {
- letra = Serial.read();
- switch(letra)
- {
- case 'l':
- Serial.print("ON\n");
- digitalWrite(luz,HIGH);
- break;
- case 'd':
- Serial.print("OFF\n");
- digitalWrite(luz,LOW);
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement