Add ES/Lab/Lab7/BinaryUP_PIN.c

This commit is contained in:
aadit 2025-09-04 12:35:09 +05:30
parent f4f4b53f24
commit e606c2cfb3

View file

@ -0,0 +1,17 @@
// Question - WAP in EC to display 8 bit UP counter on the port pin 0.4 to 0.11
#include <LPC17xx.h>
int main(){
unsigned char x = 0;
int i = 0;
LPC_PINCON -> PINSEL0 = 0x0000<<8 ;
LPC_GPIO0 -> FIODIR = 0xFF<<4;
while(1){
LPC_GPIO0 -> FIOPIN = x << 4;
x = (x+1)%256;
for(i = 0; i < 50000; i++);
}
}