Update sketchDistanceSerial-Ultrasonic.ino

This commit is contained in:
Cédric Abonnel 2022-05-15 22:00:40 +00:00
parent 6ee9698503
commit b75ba7c515
1 changed files with 1 additions and 2 deletions

View File

@ -1,4 +1,3 @@
#include "Ultrasonic.h"
#define echoPin 9 // attach pin D2 Arduino to pin Echo of HC-SR04
@ -18,7 +17,7 @@ void setup() {
}
void loop () {
distance = sensor.Ranging(CM);
distance = sensor.Ranging(CM); // CM or INC
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");