Takes median of 5 checks

A bit ugly, but whatever
This commit is contained in:
Daniel Løvbrøtte Olsen 2016-04-15 02:48:02 -04:00
parent 5d66e8b9c0
commit 2e9e3c5188

View File

@ -32,7 +32,7 @@ char cm[3];
void loop()
{
lcd.setCursor(0,1);
sprintf(cm, "%.3i", sonar.ping_cm());
sprintf(cm, "%.3i", sonar.convert_cm(sonar.ping_median(5)));
lcd.print(cm);
delay(50);
}