Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- #define RxD 10
- #define TxD 11
- char Drink = 0;
- const int led1 = 13;
- SoftwareSerial BTSerial(RxD, TxD);
- void setup(){
- // replace BAUDRATE as suggested
- BTSerial.begin(9600);
- Serial.begin(57600);
- BTSerial.print("AT\r\n");
- }
- void loop(){
- {if (BTSerial.available())
- Serial.write(BTSerial.read());
- if (Serial.available())
- BTSerial.write(Serial.read());}
- if (BTSerial=='1') //wenn das Bluetooth Modul „0“ empfängt...
- {
- digitalWrite(led1,HIGH);
- if (BTSerial=='2') //wenn das Bluetooth Modul „0“ empfängt...
- { BTSerial.write("HIER");
- digitalWrite(led1,LOW);
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement