Advertisement
chrisdaloa

ricezione_seriale_nano

Sep 16th, 2018
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <SoftwareSerial.h>
  2.  
  3. SoftwareSerial mainSerial(10, 11); // RX, TX
  4.  
  5. void setup() {
  6.   // put your setup code here, to run once:
  7. Serial.begin(115200);
  8. mainSerial.begin(57600);
  9. }
  10.  
  11. void loop() {
  12.   // put your main code here, to run repeatedly:
  13.  
  14.   if (mainSerial.available()) {                                
  15.                
  16.                Serial.println("Comando da centrale: " + mainSerial.readString());
  17.                Serial.flush();    
  18.   }                  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement