]> vault307.fbx.one Git - Sensory_Wall.git/blob - pico_soundboard.py
more sensory wall projects
[Sensory_Wall.git] / pico_soundboard.py
1 import time
2 import us100
3 from machine import Pin
4
5 uart = machine.UART(0)
6 sensor = us100.US100UART(uart)
7
8 distance=0
9
10 def measure():
11 global distance
12 distance=sensor.distance()
13 return distance
14
15
16
17 """
18 PINS Set pins like below (MUST SHARE A GROUND)
19 p0=Pin(0,Pin.OUT,Pin.PULL_UP) CAN'T USE PIN 0, already being used by LED strip
20 p0.high()
21 p1
22 p2
23 p3
24 p4
25 p5
26 p6
27 p7
28 p8
29 p9
30 p10
31
32 volU (connect to V+)
33 volD (connect to V_)
34
35 R (connect to RST)
36 """
37
38 #TODO create func to grab correct Pin and pass to trig(p) i.e. trig(p0)
39 def trig(p):
40 p.low()
41 time.sleep_ms(125)
42 p.high()
43