A poll in this instance is an object with boolean votes.
e.g "Do you like tacos? (50 for, 3 against")
The current application fetches poll data from a Spring Rest API and converts the sum of the votes into respective ratios
for each answer. --> 50 for, 3 against = 94% for, 5% against
. The application uses these values to
control two parallel strips of red and green LEDs (with PWM), where the amount of LEDs lighting up equals
the ratio of votes.
pins
: used to control green LEDs.
pins
: used to control red LEDs.
pins
: used for indicator light when transitioning between polls.
pins
: used to ground circuit.
- Example circuit diagram for this project
t = VotesToLeds()
first_votes = Votes(50, 50)
t.fade_to_poll(votes)
sleep(4)
sec_votes = Votes(1,1000)
t.fade_to_poll(sec_votes)
sleep(5)
keywords: Spring, RPi, IoT