Write an 8051 C program to toggle all the bits of P1 continuously.
Solution:
#include <reg51.h>
void main(void) {
for ( ; ; ) { //repeat forever
P1=0x55; //0x: in hex (binary)
P1=0xAA;
}
}
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.