Light_Move_Control:
Your task is to create a moving light effect by controlling all LEDs and letting only two active (on) LEDs move one from left-to-right and one from right-to-left continuously (that is, the displayed bit patterns will cycle as $81, $42, $24, $18, $18, $24, $42, $81, $00,....). The speed of the moving-light effect will be controlled by pressing one of the buttons on Port B 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 (~1 Hz for led-to-led move), and stays at the same move rate until a new button is pressed.
- BUTTON2: Moving light effect at a faster rate (~3 Hz), and stays at the same move rate until a new button is pressed.
- BUTTON3: Moving light effect at a much faster rate (~6 Hz), and stays at the same move rate until a new button is pressed.
- BUTTON4: The moving-light effect splits the active LEDs with the cycling direction first from left-to-right, then from right-to-left ($80, $40, $20, $08, $04, $02, $01, $00, $01, $02, $04, $08, $10, $20, $40, $80, $00, ....) and preserves the previous move rate until a new button is pressed.
Procedure:
- Create a new project named last-name_lab1_task1
- You may copy and paste the content of the "lab0.asm".
- Do your modifications on the source code. Assemble. Debug as necessary.
- Compute your coding resources, including program size in memory (bytes), needed data memory size (bytes), and number of registers in use. Please report them in the text box below.
- Ensure you demo the functionality to the instructor.
- Submit your task1 .asm code from the following file upload interface.