ruffyen

Untitled

Sep 21st, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <SoftwareSerial.h>
  2.  
  3. int bluetoothTx = 2;
  4. int bluetoothRx = 3;
  5.  
  6. SofwareSerial bluetooth(bluetoothTx, bluetoothRx);
  7.  
  8. void setup(){
  9. Serial.begin(9600);
  10.  
  11. bluetooth.begin(115200);
  12. bluetooth.print("$");
  13. bluetooth.print("$");
  14. bluetooth.print("$");
  15. delay(100);
  16. bluetooth.println("u,9600,N");
  17.  
  18. bluetooth.begin(9600);
  19. }
  20.  
  21. void loop(){
  22. if bluetooth.available()){
  23. Serial.print((char)bluetooth.read());
  24. }
  25. if(Serial.available()){
  26. bluetooth.print((char)Serial.read());
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment