Over the span of about 23 hours i have made a Arduino multi tasking game that is based very loosely upon the contraption you see in the picture to the left, the Schuhfried Universal Response panel. the panel is used when taking different tests to get your private/commercial pilots license. The gameplay loop revolves around multitasking 3 different things at once, they are as follows: ensure that you always press middle button when an x shows up on the middle screen, ensure that the potentiometer is always pointed at the lit up led(its the one to the left in the second picture) and lasty press the corresponding button combo when up and down are shown on the lower half of the lcd, you do this by pressing left and right buttons. This project has been a major challenge to me since i barely knew how to code (and arguably still dont know how write good code) when i started this project. The reason for me shipping this as software and not hardware as originally intended is since i want to get the ISS question in the shop. The question timeline would have expired before hardware starts to get reviewed. I am highly aware that my code might be very inefficient but i have been coding and learning to for about 20 days. I will now try to explain my code. The first part of the before setup is just labeling booleans and integers that will be used later(i am using integers to keep track of many things that i could use booleans for but i wasn't aware of booleans until about 1/3 of the code was already written and i didn't want to rewrite everything already using integers), the part of the code that i would say i am most proud of is is my fail system since it constantly works every time and i think the way i did it was a clever solution. For context the fail system works by clearing the LCD then printing YOU FAILED! Reset Arduino, the way that it ensures the Arduino is reset is by setting a delay on the code that lasts indefinitely until the Arduino is reset.
A bit explanation about how the different game modes:
For the upper lcd screen: An random number between 1 and 13 is generated every time the reaction time game is completed(by pressing middle button when x shows on lcd), it also gets an random number between 150ms and 500ms that determines how fast the numbers will be printed on the lcd screen. This effects your time to react and leaves it at somewhere between 450ms and 1.5s.
Led minigame: a number between 1 and 2 is picked randomly, this decides what led is going to light up, it then determines if the potentiometer potentiometer is pointed at the lit up LED(i am a bit unsure if this works perfectly on pc). i determined the correct position for potentiometer my pointing it at at the leds to see what angles would work for minimum and max, this is also why i am a bit unsure as to if this works fully on pc since i dont know if the potentiometer outputs the same angle, i haven't experienced anything indicating that this is doesn't work on pc though during my playtesting.
If you want to try my game in your web browser click the demo link and click the big green button in the top right that says start the simulation when you hover over it. And when you fail to multitask press the square in the top right of the window to stop the simulation (very important do not pause it, you have to stop it!). The controls for the minigame are as follows: 1 = leftmost button, when an X appears on the lcd screen press the middle button to complete and restart it, if the bottom half of the lcd say down press the left most button and if the lcd says up press the rightmost button(combine those inputs if up then down and down then up) and lastly for the red led lights just point the potentiometer towards it. If you find the game very hard to play on pc it is because this wasn't designed for it, i have fully built it using my own Arduino uno and parts that come with the Arduino starter kit and verified that it works irl.
Cant write more, text limit.
- 10 devlogs
- 23h