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); +}