Question: Lab 4 . 1 . 1 : For / While Loops and Arrays Write a program that will output the sequence shown below to the
Lab : ForWhile Loops and Arrays
Write a program that will output the sequence shown below to the LEDs. Remember to initialize all of the pins of Port S at address $ as an output by setting all of the bits of the DDR of Port S at address $A
Sequence $$$$$$
The program should continuously loop through the six values above, outputting each value of the sequence one at a time on the LEDs. When the end of the sequence is reached, the program should start over at the beginning of the sequence.
Load the effective address of the sequence to Index Register so that points to the first value of the Sequence. Use postauto increment addressing to cycle through each element of the sequence. Either use a terminator at the end of the list while loop or a counter to count to the end of the list for loop
To debug, step through the program. When running the program at speed, all the lights will appear to be on one clock cycle is so the MCU will execute the instructions so fast that all of the LEDs will appear as if they are always on
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
