Guest User

Untitled

a guest
Nov 8th, 2015
8,614
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×