Advertisement
DamianoNisoli

Prova BT

Jul 15th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <SoftwareSerial.h>
  2. int RX = 3;
  3. int TX = 2;
  4. SoftwareSerial BT(RX, TX);
  5.  
  6. long VAL = 0 ;
  7.  
  8. void setup() {
  9.   Serial.begin(9600);  // put your setup code here, to run once:
  10.   BT.begin(9600);
  11. }
  12.  
  13. void loop() {
  14.   // put your main code here, to run repeatedly:
  15.  
  16.   if (BT.available()); {
  17.     VAL = BT.parseInt();
  18.  
  19.     if (VAL > 0) {
  20.       Serial.println(VAL);
  21.     }
  22.   }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement