Write an 8051 C program to toggle all the bits of P1 continuously.

By

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;      
  }
}

0 comments:

Post a Comment

If you have any questions or droughts feel free to ask here.