Light_Move_Control:
Your task is to create a moving light effect by
controlling all LEDs and letting only two
active (on) LEDs move from the center to the
sides continuously (that is, the displayed bit
patterns will cycle as \$18, \$24, \$42, \$81,
\$00, \$18, \$24, ....). The speed of the moving-
light effect will be controlled by pressing one
of the buttons among PortB 0-4 with the
following functionality.
BUTTON0: Turn off all the LEDs and stay in the
off state until a new button is pressed.
BUTTON1: Moving light effect at a slow rate (~2
Hz for led-to-led move), and stay at the same
move rate until a new button is pressed.
BUTTON2: Moving light effect at a faster rate
(~4 Hz), and stay at the same move rate until a
new button is pressed.
BUTTON3: Moving light effect at a much faster
rate (~8 Hz), and stay at the same move rate
until a new button is pressed.
BUTTON4: The moving-light effect changes the
cycling direction from the sides to the center
(\$00, \$81, \$42, \$24, \$18, \$00, \$81, ....) and
preserves the direction and previous move rate
until a new button is pressed.