Chapter 03 - Reaction Timer Game - Alternate program with a different Circuit
AndyMenon
Posts: 26
Hi Folks,
Total Parallax Noobie here If I've posted this in the wrong section, I apologize in advance.
Here's my first attempt at writing a program for the Reaction Timer Game from Chapter 03 in the Parallax Basic Stamp "What's a Microcontroller" book.
For those who're already familiar with this, I haven't yet included the random timer feature because I wanted this program to swith LED colors within the predicatable time of 1 second to test the cheat feature.
Here are some of my changes:
Cheers,
Andy
Total Parallax Noobie here If I've posted this in the wrong section, I apologize in advance.
Here's my first attempt at writing a program for the Reaction Timer Game from Chapter 03 in the Parallax Basic Stamp "What's a Microcontroller" book.
For those who're already familiar with this, I haven't yet included the random timer feature because I wanted this program to swith LED colors within the predicatable time of 1 second to test the cheat feature.
Here are some of my changes:
- I lost the Bi-Color LED, and therefore used the Dual LED program from Chapter 03 with the pull-down resistor. Pic is attached .
- For now, the upper push button has no part to play in the game, and can therefore be ignored
- My program manipulates the 2 LEDs to change colors instead of working with a single Bi-Color LED.
- Also, I have incorporated an alternate solution to detect if the player is letting go of the button before the LED turns yellow and displays a message appropriately.
Cheers,
Andy
Comments
Here's what I mean - In the pseudocode section, we have 3 items to fix
Item 1 Fix: Removing the PAUSE 1 inside the FOR LOOP removes the code overage
Item 2 Fix: Adding randomness to the LED change time, increases the pause time from 1 to 2 seconds
Item 3 Fix: In the pseudocode section there are 2 conditions:
If timeCounter <=2
Display Cheat Message
Else (if timeCounter > 1)
Display ReactionTime
But when timeCounter > 1, it may also mean that it can fall under the first condition timeCounter <=2, in which case the program never gets to go into the Else condition.
Am I reading this wrong, or does my reasoning make sense?
Thanks and Happy Coding!
Andy
Does that make sense?