Update sketchdistanceSerial.ino
This commit is contained in:
parent
28c1814f8e
commit
8012e907b1
|
@ -1,5 +1,5 @@
|
|||
#include "Ultrasonic.h"
|
||||
Ultrasonic ultrasonic(8,9); // Trig et Echo
|
||||
Ultrasonic capteur(8,9); // Trig et Echo
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
|
@ -8,9 +8,9 @@ void setup() {
|
|||
}
|
||||
|
||||
void loop () {
|
||||
int dist = ultrasonic.Ranging(CM);
|
||||
int dist = capteur.Ranging(CM);
|
||||
Serial.print(dist);
|
||||
Serial.println(" cm");
|
||||
|
||||
delay(100);
|
||||
delay(100); // 100 ms
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue