Change pin for movement sensor

master
Elis Axelsson 2017-08-11 08:40:56 +02:00
parent 521207c108
commit 3ac319708b
3 changed files with 20 additions and 2 deletions

View File

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

View File

@ -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())

View File

@ -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