--UPDATE TWO--
Now I've come up with a way to reduce the amount of code drastically.
I will use 10 functions to turn the LEDs on and off depending on the current time. This is 'eight' for example:
def displayEight(led_1, led_2, led_3, led_4, led_5):
GPIO.output(led_1, True)
GPIO.output(led_2, True)
GPIO.output(led_3, True)
GPIO.output(led_4, True)
GPIO.output(led_5, False)
In addition I installed another row of LEDs today but now I don't have any more LEDs and need to order some which is why I won't be posting any updates for a few days.
Here's how my breadboard is looking right now (don't mind the knife, I needed to open a pack of resistors):
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Just some random code, not tested, i'm not fluent in Python...
def display(number)
var i=conversion_array[number]
GPIO.output(led_1, i&1)
i = i >> 1
GPIO.output(led_2, i&1)
i = i >> 1
GPIO.output(led_3, i&1)
i = i >> 1
GPIO.output(led_4, i&1)
i = i >> 1
GPIO.output(led_5, i&1)
Now you just have to create conversion_array
Are you sure? yes | no