fix serial rx flush in examples
This commit is contained in:
parent
aa14035c94
commit
ef2268ca22
|
@ -166,7 +166,7 @@ void loop() {
|
||||||
} else {
|
} else {
|
||||||
Serial.setTimeout(40);
|
Serial.setTimeout(40);
|
||||||
freq = Serial.parseInt();
|
freq = Serial.parseInt();
|
||||||
Serial.flush();
|
while (Serial.available()) Serial.read();
|
||||||
radio.frequency(freq);
|
radio.frequency(freq);
|
||||||
Serial.print("set frequency: ");
|
Serial.print("set frequency: ");
|
||||||
Serial.println(freq);
|
Serial.println(freq);
|
||||||
|
|
|
@ -135,7 +135,7 @@ void loop() {
|
||||||
} else {
|
} else {
|
||||||
Serial.setTimeout(40);
|
Serial.setTimeout(40);
|
||||||
freq = Serial.parseInt();
|
freq = Serial.parseInt();
|
||||||
Serial.flush();
|
while (Serial.available()) Serial.read();
|
||||||
radio.frequency(freq);
|
radio.frequency(freq);
|
||||||
Serial.print("set frequency: ");
|
Serial.print("set frequency: ");
|
||||||
Serial.println(freq);
|
Serial.println(freq);
|
||||||
|
|
Loading…
Reference in New Issue