Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <SoftwareSerial.h>  
  2.  
  3. const int rxpin = 2;  
  4. const int txpin = 3;  
  5. SoftwareSerial bluetooth(rxpin, txpin);  
  6.  
  7. void setup(){
  8. Serial.begin(38400);  
  9. bluetooth.begin(38400);  
  10. }
  11.  
  12. void loop(){
  13. if(bluetooth.available()){  
  14. char c = bluetooth.read();  
  15. Serial.write(c);  
  16. }
  17. if(Serial.available()){
  18. char c = Serial.read();
  19. bluetooth.write(c);  
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement