Write an 8051 C program to toggle bits of P1 continuously forever with some delay.
Solution:
#include <reg51.h>
void main(void) {
unsigned int x;
for (;;) {
P1=0x55;
for (x=0;x<40000;x++); //time delay
P1=0xAA;
for (x=0;x<40000;x++); }}
All About 8051 Microcontroller.Learn all basics of Microcontrollers and Embedded Systems.
Subscribe to our newsletter to get the latest updates to your inbox. ;-)
Your email address is safe with us!
© 2015 8051 Microcontroller. Designed by Bassar Patel
0 comments:
Post a Comment
If you have any questions or droughts feel free to ask here.