Add ES/Lab/LAB6/BinaryUpCounter.c

This commit is contained in:
aadit 2025-08-28 13:11:56 +05:30
parent 7e1ff29eac
commit 968890a5fe

View file

@ -0,0 +1,21 @@
#include <LPC17xx.h>
int main(){
unsigned long x, i;
// from P1.24 -> 31
LPC_PINCON->PINSEL3 &= 0x0000FFFF; // values
LPC_GPIO1->FIODIR = 0xFF000000;
x = 0x01000000; // new variable
while(1){
x = 0x01000000;
for(i=0;i<256;i++){
LPC_GPIO1->FIOSET=x;
x = x + 0x01000000;
LPC_GPIO1->FIOCLR=-x;
}
}
}