SHARE
TWEET

Untitled

a guest Nov 8th, 2015 7,954 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. char msg = ' '; //contains the message from arduino sender
  2. const int led = 13; //led at pin 13
  3. void setup() {
  4. Serial.begin(9600);//Remember that the baud must be the same on both arduinos
  5. pinMode(led,OUTPUT);
  6. }
  7. void loop() {
  8. while(Serial.available() > 0) {
  9.            msg=Serial.read();
  10.            if(msg=='H') {
  11.                digitalWrite(led,HIGH);
  12.            }
  13.            if(msg=='L') {
  14.                 digitalWrite(led,LOW);
  15.            }
  16. delay(1000);
  17. }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top