You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
642 B
Python
38 lines
642 B
Python
#!/bin/python3
|
|
|
|
import RPi.GPIO as GPIO
|
|
import time
|
|
|
|
GPIO.setwarnings(False)
|
|
|
|
GPIO.setmode(GPIO.BCM)
|
|
|
|
dac = [26, 19, 13, 6, 5, 11, 9, 10]
|
|
number = [0, 0, 0, 0, 0, 0, 0, 1]
|
|
|
|
GPIO.setup(dac, GPIO.OUT)
|
|
GPIO.output(dac, 0)
|
|
|
|
#GPIO.output(dac, number)
|
|
|
|
#time.sleep(15)
|
|
|
|
nums = [
|
|
[1, 1, 1, 1, 1, 1, 1, 1], #255
|
|
[0, 1, 1, 1, 1, 1, 1, 1], #127
|
|
[0, 1, 0, 0, 0, 0, 0, 0], #64
|
|
[0, 0, 1, 0, 0, 0, 0, 0], #32
|
|
[0, 0, 0, 0, 0, 1, 0, 1], #5
|
|
[0, 0, 0, 0, 0, 0, 0, 0], #0
|
|
]
|
|
|
|
for num in nums:
|
|
print(num)
|
|
GPIO.output(dac, num)
|
|
time.sleep(20)
|
|
GPIO.output(dac, 0)
|
|
|
|
GPIO.output(dac, 0)
|
|
|
|
GPIO.cleanup()
|