Pages: [1]   Go Down
Author Topic: Suggestions for Pressing Button Early/Late Indication  (Read 289 times)
0 Members and 1 Guest are viewing this topic.
US
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I am building an LED game based one off the StopIt! LED game from instructables.
Source:http://www.instructables.com/id/StopIt-LED-Game-powered-by-arduino/

I am trying to figure a way to indicate if the player had hit the targeted LED too early, a little early, a little late, and very late.
Is that possible?

Ex. 4 LEDs, the target LED is the last LED, however, the player hits the LED a little early before the 4th LED turned on, so the serial monitor would indicate to them that it was "A little early."

Sorry if this may sound confusing. I'm quite new to the arduino.
Anything will help! Thanks!
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I am trying to figure a way to indicate if the player had hit the targeted LED too early, a little early, a little late, and very late.
What does hitting an LED accomplish? Is it anything like lighting up a switch?
Logged

US
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I am trying to figure a way to indicate if the player had hit the targeted LED too early, a little early, a little late, and very late.
What does hitting an LED accomplish? Is it anything like lighting up a switch?

Oh i left out I have a button. You don't hit the LED, you hit a button. The LEDs are turning on one by one, and the goal is to hit button on the 4th LED.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The LEDs are turning on one by one, and the goal is to hit button on the 4th LED.
How are the LEDs being turned on? If there is some detectable pattern, you can determine when the switch is pressed (using millis()), and when the LED is lit (ditto), and determine the time between the two events. It is up to you to categorize the interval as too early, early, on time, late, or too late.
Logged

Pages: [1]   Go Up
Jump to: