Takes median of 5 checks
A bit ugly, but whatever
This commit is contained in:
parent
5d66e8b9c0
commit
2e9e3c5188
@ -32,7 +32,7 @@ char cm[3];
|
|||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
lcd.setCursor(0,1);
|
lcd.setCursor(0,1);
|
||||||
sprintf(cm, "%.3i", sonar.ping_cm());
|
sprintf(cm, "%.3i", sonar.convert_cm(sonar.ping_median(5)));
|
||||||
lcd.print(cm);
|
lcd.print(cm);
|
||||||
delay(50);
|
delay(50);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user