Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- SoftwareSerial bt(53 , 52); // TX RX
- byte caractere;
- byte portao = 49; // 1 a
- void setup()
- {
- Serial.begin(9600);
- bt.begin(9600);
- pinMode(portao, OUTPUT);
- }
- void loop()
- {
- if (bt.available())
- {
- caractere = bt.read();
- if (caractere == 'A')
- {
- digitalWrite(portao, HIGH); // 1 a
- bt.println("OK, port A/F.");
- }
- if (caractere == 'a')
- {
- digitalWrite(portao, LOW);
- bt.println("OK, port a/f.");
- }
- }
- char ler = 0;
- if(Serial.available())
- {
- ler = Serial.read();
- Serial.println(ler);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement