* ButtonLED * This file contains the functions that control the button game LEDs. * The LEDs are controlled using a 74HC595 (output) shift register. * Lights an LED corresponding to a specific button. buttonInput Param: uint8_t called buttonNum, specifies which LED(s) should light up at a given time Returns: nothing 1) for each of the 8 LEDSs in the game if the buttonNum corresponding to a specific LED is equal to 1 turn that LED on by calling setSerial function and passing it a 1 else turn that LED off by calling setSerial function and passing it a 0 pulse the serial clock using the sclkPulse function end for 2) pulse the serial clock using the rclkPulse function end buttonInput * Turns on all button LEDs. buttonLightsOn takes no parameters, returns nothing 1) for each of the 8 LEDSs in the game turn that LED on by calling setSerial function and passing it a 1 pulse the serial clock using the sclkPulse function end for 2) pulse the serial clock using the rclkPulse function end buttonLightsOn * Sets the SER (data) line of the output shift register. Private function. setSerial Param: uint8_t input (data to shift in, i.e. 0 or 1) Return: nothing 1) if the input passed to setSerial is a 1 set the serial register pin (SREG_SER_PIN) high; 2) else if the input passed to setSerial is a 0 set the serial register pin (SREG_SER_PIN) low; end if end setSerial * Pulses the shift clock. Private function. sclkPulse takes no parameters, returns nothing 1) set the serial clock pin (SREG_SCLK_PIN) high 2) pause using the delay function 3) set the serial clock pin (SREG_SCLK_PIN) low end sclkPulse * Pulses the register clock. Private function. rclkPulse 1) set the register clock pin (SREG_RCLK_PIN) high; 2) pause using the delay function 3) set the register clock pin (SREG_RCLK_PIN) low; end rclkPulse * Delays for a short period of time to allow for clock pulses to be detected. * Private function. delay takes no parameters, returns nothing 1) declare and set a dummy variable equal to a number 2) for 100 times (to stall) add 1 to the dummy variable end for end delay