Advertisement
Guest User

Untitled

a guest
May 26th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. void setup() {
  2.  
  3. // Setup computer to Arduino serial
  4. Serial.begin(9600);
  5.  
  6. // Setup Arduino to ESP8266 serial
  7. // Use baud rate 115200 during firmware update
  8. Serial1.begin(9600);
  9.  
  10. }
  11.  
  12. void loop() {
  13.  
  14. // Send bytes from ESP8266 to computer
  15. if ( Serial1.available() ) {
  16. Serial.write( Serial1.read() );
  17. }
  18.  
  19. // Send bytes from computer back to ESP8266
  20. if ( Serial.available() ) {
  21. Serial1.write( Serial.read() );
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement