Advertisement
Guest User

Bluetooth test

a guest
Feb 11th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <SoftwareSerial.h>
  2.  
  3. SoftwareSerial bluetooth(8,7);
  4.  
  5. void loop()
  6. {
  7.   if (bluetooth.available())
  8.   {
  9.     Serial.write(bluetooth.read());
  10.   }
  11.  
  12.   if (Serial.available())
  13.   {
  14.     bluetooth.write(Serial.read());
  15.   }
  16.  
  17. }
  18.  
  19.  
  20.  
  21. void setup()
  22. {
  23.   Serial.begin(9600);
  24.   bluetooth.begin(9600);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement