void setup() {
// put your setup code here, to run once:
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() {
if(Serial.available()>0) {
float pwm = Serial.parseFloat();
Serial.println(pwm);
Serial.flush();
while (Serial.available()) {
Serial.read(); // Consuma i caratteri rimanenti nel buffer
}
}
}