Skip to content

Instantly share code, notes, and snippets.

@nilsonpessim
Created March 7, 2016 20:30
Show Gist options
  • Save nilsonpessim/64c8d05837f1f48c791a to your computer and use it in GitHub Desktop.
Save nilsonpessim/64c8d05837f1f48c791a to your computer and use it in GitHub Desktop.
#include <SoftwareSerial.h>
SoftwareSerial Bluetooth (10, 11);
int led = 13;
void setup(){
Bluetooth.begin(9600);
pinMode(led,OUTPUT);
}
void loop(){
char caracter = Bluetooth.read();
if (caracter == '1') {
digitalWrite(led,HIGH);
}
if (caracter == '2') {
digitalWrite(led,LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment