Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Getting Started Read the code and the comments carefully to understand each step

ID: 3702761 • Letter: G

Question

Getting Started Read the code and the comments carefully to understand each step of the program. The program uses a simple loop [ic100000000) loop as a delay to slow the changes sent to the LEDs to allow us to see them. As a first exercise, modify the or loop to wait a much shorter time by changing the value 100000000 to 1000 and run the program again. You will see that the speed has increased to the point where all the LEDs appear to be lit and flashing. Define 801 zegiatea 1 ue.aigaed ?; Delay vaiabe Loop tozevez /Output FF to the LRD Port Output 00 to the LRD Port / End while) 1oop /- End of main Exercise 1 Extend the supplied example to light all LEDs Later, in exercise 5, you will need to create a rotating bit pattern, rather than one going up and then down. This will be harder as the variable you'll be using will hold 16-bits, but you will only be working with the bottom &

Explanation / Answer

#include <reg51.h>

void main(void)

{

unsigned int i;

while(1)

{
P3=0x00;

for(int i=1000;i>0;i--)

P0=0xff;

for(int i=1000;i>0;i--)

P0=0x00;

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote