Browse Source

Update pins

master
Elis Axelsson 5 years ago
parent
commit
20ed3866c1
  1. 4
      README.org
  2. 2
      code/main.py

4
README.org

@ -20,8 +20,8 @@ ampy --port /dev/ttyUSB0 put hcsr04.py
*** HCSR04 Pins
| Pin on component | Pin on card |
|------------------+-------------|
| Trig | D0 |
| Echo | D3 |
| Trig | D3 |
| Echo | D4 |
| Vcc | 5V |
| GND | GND |

2
code/main.py

@ -13,7 +13,7 @@ def blink():
def distance():
sensor = HCSR04(trigger_pin=pins.D0, echo_pin=pins.D3)
sensor = HCSR04(trigger_pin=pins.D3, echo_pin=pins.D4)
while True:
print(sensor.distance_cm())

Loading…
Cancel
Save