uas_arduino

Serial Light Flasher

Mar 8th, 2013
27
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void setup(){
  2. Serial.begin(9600);
  3. pinMode(5,OUTPUT);
  4. }
  5.  
  6. byte data = 0;
  7.  
  8. void loop(){
  9. if(Serial.available() > 0){
  10. if(Serial.read() == 'o'){
  11. digitalWrite(5,HIGH);
  12. }else{
  13. digitalWrite(5,LOW);
  14. }
  15. }
  16. }
RAW Paste Data