Created
January 5, 2017 04:03
-
-
Save taesamja/a1942ce1f465605fca1945361294246b to your computer and use it in GitHub Desktop.
This file contains 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 <SoftwareSerial.h> | |
int rx=2; int tx=3; | |
SoftwareSerial BTSerial(rx, tx); | |
const int ledPin = 13; | |
void setup() { | |
BTSerial.begin(9600); | |
pinMode(ledPin, OUTPUT); | |
} | |
void loop() { | |
if(BTSerial.available()) { | |
char ind = BTSerial.read(); | |
if(ind == 'H') | |
digitalWrite(ledPin, HIGH); | |
if(ind == 'L') | |
digitalWrite(ledPin, LOW); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment