Advertisement
DamianoNisoli

Untitled

Jul 13th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Servo.h>
  2. Servo SV;
  3.  
  4. #include <SoftwareSerial.h>
  5. int rxPin = 3;
  6. int txPin = 2;
  7. SoftwareSerial bluetooth(rxPin, txPin);
  8.  
  9. int VALORE;
  10. int VAL1;
  11.  
  12.  
  13. void setup() {
  14.   SV.attach(7);
  15.   Serial.begin(9600);   //Setta il baund per la trasmissione seriale
  16.  
  17.   bluetooth.begin(9600); //set baud rate
  18.   int VALORE = 0;
  19.  
  20. }
  21.  
  22. void loop() {
  23.  
  24.   if (bluetooth.available()) {
  25.     VALORE = bluetooth.read();
  26.     Serial.println(VALORE );
  27.     SV.write(VALORE );
  28.   }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement