Skip to content

Commit e106ef8

Browse files
committed
Updating to Modulino 0.4.0 lib
1 parent b00703c commit e106ef8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

FlappyLED.ino

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,12 @@ void distanceLoop() {
291291

292292
#if !defined(BUTTONS)
293293

294-
float d = distanceSensor.get();
295-
296294
if(!distanceSensor.available()){
297295
delay(1);
298296
continue;
299297
}
300298

299+
float d = distanceSensor.get();
301300
unsigned long m = millis();
302301

303302
if(!isnan(d) && d < MAX_TOF_H && d > MIN_TOF_H){
@@ -329,13 +328,13 @@ void distanceLoop() {
329328
delay(1);
330329
}
331330

332-
float distance = distanceSensor.get();
333-
334331
if(!distanceSensor.available()){
335332
delay(1);
336333
return;
337334
}
338335

336+
float distance = distanceSensor.get();
337+
339338
if(isnan(distance)){
340339
#ifdef DEBUG
341340
Serial.println("Distance is NAN");

0 commit comments

Comments
 (0)