Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- int bluetoothTx = 6;
- int bluetoothRx = 7;
- SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
- void setup() {
- bluetooth.begin(9600);
- Serial.begin(9600);
- }
- void loop() {
- if(bluetooth.available()>0)
- {
- unsigned int blue = bluetooth.read();
- if(blue == 2)
- {
- Serial.println("Liga");
- delay(500);
- }
- if(blue == 1)
- {
- Serial.println("Desliga");
- delay(500);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement