diff --git a/2/2-2-bin-number.py b/2/2-2-bin-number.py new file mode 100644 index 0000000..797970b --- /dev/null +++ b/2/2-2-bin-number.py @@ -0,0 +1,37 @@ +#!/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() diff --git a/2/data.txt b/2/data.txt new file mode 100644 index 0000000..a7208d4 --- /dev/null +++ b/2/data.txt @@ -0,0 +1,4 @@ +# X Y +255 3.241 +127 1.619 +64 0.819