Scusami ma non ho capito. Devo aggiungerlo sullo sketch che abbiamo usato fin ora per comandare i servo?
Cioè a questo? :
#include <Servo.h>
#include <SoftwareSerial.h>
Servo myservo;
int rxPin = 3;
int txPin = 2;
SoftwareSerial bluetooth(rxPin, txPin);
String message;
int grado = 0;
int pinServo = 10;
void setup() {
bluetooth.begin(9600);
Serial.begin (9600);
myservo.attach( pinServo );
myservo.write( grado );
}
void loop() {
if (bluetooth.available()) {
char c = bluetooth.read();
if (c == 'H') {
grado++;
myservo.write( grado );
Serial.print(c);
Serial.print(" ");
Serial.println(grado);
}
if (c == 'L') {
grado--;
myservo.write( grado );
Serial.print(c);
Serial.print(" ");
Serial.println(grado);
}
}
}