Browse Source

Change pin for movement sensor

master
Elis Axelsson 5 years ago
parent
commit
3ac319708b
  1. 2
      README.org
  2. 2
      code/main.py
  3. 18
      code/pinouts.py

2
README.org

@ -38,7 +38,7 @@ main.distance()
|------------------+-------------|
| 5V | 5V |
| GND | GND |
| OUT | D1 |
| OUT | D2 |
*** Set up movement sensor
#+begin_src python

2
code/main.py

@ -21,7 +21,7 @@ def distance():
def movement():
sensor = machine.Pin(pins.D1, mode=machine.Pin.IN, pull=None)
sensor = machine.Pin(pins.D2, mode=machine.Pin.IN, pull=None)
while True:
print(sensor.value())

18
code/pinouts.py

@ -14,3 +14,21 @@ class NodeMCU:
D8 = 15
D9 = 3
D10 = 1
class Wemos:
"""
Pinout mapping of the Wemos board I've got.
"""
D0 = 16
D1 = 5
D2 = 4
D3 = 0
D4 = 2
D5 = 14
D6 = 12
D7 = 13
D8 = 15
RX = 3
TX = 1

Loading…
Cancel
Save