Hello,
I started to program a reaction game and i started to debug the code and fix everything but i just ended up with more problems,
Please help
(orgianl before trying to fix)
// boolean to save memory
boolean ON = 1 ;
boolean OFF = 0 ;
// 3 pins used for LEDs,
byte led_pins[3] = {8,9,10} ;
byte button_pin = 2 ;
byte success_led = 1 ; // refers to pin 9
unsigned int time_change = 50 ;
unsigned int colorswitch_delay = 500 ;
unsigned int push_pause = 2000 ;
void setup(){
for (int i=0 ; i pinMode( led_pins*, OUTPUT ) ;*
- }*
- pinMode( button_pin, INPUT ) ;*
}
void loop(){
- boolean button_state = OFF ;*
for ( int i=0 ; i digitalWrite( led_pins*, HIGH ) ;*
* for ( int t=0 ; t button_state = digitalRead( button_pin ) ;*
* if ( button_state == ON ){
delay( push_pause ) ;*
* button_state = OFF ;
if ( i == success_led )
colorswitch_delay -= time_change ;
_ else*_
* colorswitch_delay += time_change ;
_ break ;_
_ }_
_ delay( 5 ) ;_
_ }_
digitalWrite( led_pins, LOW ) ;
_ }
}*_