From c5b2ed496f0df57637ee3978e6b4f4b89165aedf Mon Sep 17 00:00:00 2001 From: Elis Axelsson Date: Mon, 24 Jul 2017 20:06:45 +0200 Subject: [PATCH] Docs for my small card --- README.org | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.org b/README.org index f291374..448f3cc 100644 --- a/README.org +++ b/README.org @@ -9,3 +9,22 @@ pip install -r requirements.txt #+BEGIN_SRC sh picocom /dev/ttyUSB0 -b115200 #+END_SRC + +* Small card +** Set up distance measuring +#+begin_src python +from hcsr04 import HCSR04 +import time + +sensor = HCSR04(trigger_pin=16, echo_pin=0) + +while True: + print(sensor.distance_cm()) + time.sleep(1) +#+end_src + +** HCSR04 Pins +Trig -- D0 +Echo -- D3 +Vcc -- 5V +GND -- GND