We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08d2495 commit 4f15175Copy full SHA for 4f15175
examples/Modulino_Distance/Basic/Basic.ino
@@ -9,7 +9,9 @@ void setup() {
9
}
10
11
void loop() {
12
- int measure = distance.get();
13
- Serial.println(measure);
+ if (distance.available()) {
+ int measure = distance.get();
14
+ Serial.println(measure);
15
+ }
16
delay(10);
17
examples/Utilities/Modulino_PlugNPlay/Modulino_PlugNPlay.ino
@@ -40,7 +40,7 @@ void loop() {
40
skip = (skip + 1) % 5;
41
42
43
- pitch = encoder.get() + distance.get();
+ pitch = encoder.get() + (distance.available() ? distance.get() : 0);
44
45
if (Serial.available() && Serial.read() == 's') {
46
imu.update();
0 commit comments