We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b00703c commit e106ef8Copy full SHA for e106ef8
FlappyLED.ino
@@ -291,13 +291,12 @@ void distanceLoop() {
291
292
#if !defined(BUTTONS)
293
294
- float d = distanceSensor.get();
295
-
296
if(!distanceSensor.available()){
297
delay(1);
298
continue;
299
}
300
+ float d = distanceSensor.get();
301
unsigned long m = millis();
302
303
if(!isnan(d) && d < MAX_TOF_H && d > MIN_TOF_H){
@@ -329,13 +328,13 @@ void distanceLoop() {
329
328
330
331
332
- float distance = distanceSensor.get();
333
334
335
336
return;
337
338
+ float distance = distanceSensor.get();
+
339
if(isnan(distance)){
340
#ifdef DEBUG
341
Serial.println("Distance is NAN");
0 commit comments