Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <SoftwareSerial.h>
  2.  
  3. #define RxD 10
  4. #define TxD 11
  5. char Drink = 0;
  6. const int led1 = 13;
  7. SoftwareSerial BTSerial(RxD, TxD);
  8.  
  9. void setup(){
  10. // replace BAUDRATE as suggested
  11. BTSerial.begin(9600);
  12. Serial.begin(57600);
  13. BTSerial.print("AT\r\n");
  14.  
  15. }
  16.  
  17. void loop(){
  18. {if (BTSerial.available())
  19. Serial.write(BTSerial.read());
  20.  
  21. if (Serial.available())
  22. BTSerial.write(Serial.read());}
  23.  
  24. if (BTSerial=='1') //wenn das Bluetooth Modul „0“ empfängt...
  25. {
  26. digitalWrite(led1,HIGH);
  27.  
  28. if (BTSerial=='2') //wenn das Bluetooth Modul „0“ empfängt...
  29. { BTSerial.write("HIER");
  30. digitalWrite(led1,LOW);
  31. }
  32. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement