From ec33927fc98a1ea930eb435d78898e2b0602b0d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Abonnel?= Date: Sun, 15 May 2022 17:38:28 +0000 Subject: [PATCH] Add new file --- arduino/sketchist-pserial.ino | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 arduino/sketchist-pserial.ino diff --git a/arduino/sketchist-pserial.ino b/arduino/sketchist-pserial.ino new file mode 100644 index 0000000..6fa38c4 --- /dev/null +++ b/arduino/sketchist-pserial.ino @@ -0,0 +1,16 @@ +#include "Ultrasonic.h" +Ultrasonic ultrasonic(8,9); // Trig et Echo + +void setup() { + Serial.begin(9600); + pinMode (11, OUTPUT); + pinMode (12, OUTPUT); +} + +void loop () { + int dist = ultrasonic.Ranging(CM); + Serial.print(dist); + Serial.println(" cm"); + + delay(100); +}