Question

Using uVision: Write a 2 Port B. U inCprogram that generates a 1 second square wave on Pin sing the generated signal from that Pin 2, as an input to Pin 3 Port B. th e ed LED at the same rate and the Blue LED at half the rate of the Red LED. (Turn in your source code as Q7.c)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<reg52.h> // special function register declarations
// for the intended 8051 derivative

sbit LED = P2^0; // Defining LED pin

void Delay(void); // Function prototype declaration

void main (void)
{
while(1) // infinite loop
{
LED = 0; // LED ON
Delay();
LED = 1; // LED OFF
Delay();
}
}

void Delay(void)
{
int j;
int i;
for(i=0;i<10;i++)
{
for(j=0;j<10000;j++)
{
}
}
}

Add a comment
Know the answer?
Add Answer to:
Using uVision: Write a 2 Port B. U inCprogram that generates a 1 second square wave...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT