Provides the functions for initializing, resetting, and writing patterns to the Prize LED hardware
Take 2 arguments of type OutputT (clock and data) and return nothing. When main calls this function it tells the PrizeLED Module which ports are used for the corresponding shift register, initializes these ports and turns off all the LEDs.
Light the default pattern (2 winning slots at the right end)
Take no argument and shift the prize slots to the left
Take no argument and shift the prize slots to the right
Take no argument and return the current prize pattern
e.g if winning slot is slot 2 and slot 3, return BIT3HI | BIT2HI or 1100
Take a number of type unsigned int and light the corresponding pattern. When bit i-1 of this number is 1, light the prize LED at slot i.
e.g if pattern=BIT5HI | BIT3HI | BIT8HI then LightLEDPattern(pattern) will light up slot 6,4 and 9
Clock and Data hold output configuration data for the clock and data pins.
PrizePattern is used to store the current LED pattern
Pass the argument of PrizeLEDInit (two InputT) to the module static variables Clock and Data
Initialize the shift register corresponding to Clock and Data
LightLEDpattern(0) (turn off all the LEDs)
Record the current LED pattern to prizePos
Shfit this number to the left, record to to prizePosNew
If bit 8 of the initial prizePos is 1, then bit 0 of the prizePosNew is 1
LightLEDpattern(prizePosNew)
Record the current LED pattern to prizePos
Shfit this number to the right, record to to prizePosNew
If bit 0 of prizePos is 1, then bit 8 of the prizePosNew is 1
LightLEDpattern(prizePosNew)
Return the value of static variable PrizePattern
LightLEDpattern(3) (3=BIT0HI | BIT1HI: => light the two slots at the right end)
Repeat 9 times
If bit 0 of pattern is 1
Use LightNext(Clock,Data) to shift 1 in
Else use DontLightNext(Clock,Data) to shift 0 in
Shift pattern right (pattern >>=1)