Created
July 2, 2017 12:31
-
-
Save michaelsarduino/9e9fe816ea733fda184222c031d7f82d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftSerial.h> | |
#include <TinyPinChange.h> | |
SoftSerial bluetooth(2, 3); | |
void setup() { | |
bluetooth.begin(9600); | |
pinMode(0, OUTPUT); | |
pinMode(1, OUTPUT); | |
} | |
void loop() { | |
if(bluetooth.available() > 0) | |
{ | |
int status_led = bluetooth.read(); | |
if(status_led == 49) | |
{ | |
digitalWrite(0, HIGH); | |
digitalWrite(1, HIGH); | |
} | |
if(status_led == 48) | |
{ | |
digitalWrite(0, LOW); | |
digitalWrite(1, LOW); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment