A program that plays simone says with the user. More...
Classes | |
| class | lab3.simonSays |
| A class that plays simon says with the user using an LED and a button. More... | |
Variables | |
| lab3.pinA5 = pyb.Pin (pyb.Pin.cpu.A5) | |
| lab3.tim2 = pyb.Timer(2, freq = 20000) | |
| lab3.t2ch1 = tim2.channel(1, pyb.Timer.PWM, pin=pinA5) | |
| lab3.game = simonSays(t2ch1) | |
A program that plays simone says with the user.
Link to Source Code: https://bitbucket.org/ebriefer/me305_lab/src/master/Lab%203/lab3.py Demonstration https://youtu.be/LWRrAM0yLX0 This program randomly generates a sting of LED flashes of varying length. Then, it compares the durration of button presses by the user to the pattern, and if they are sufficiently close, congratulates the user and generates another random sequence for them to replicate. The pattern length and difficulty gradually increases as the user progresses. State machine diagram: