From 1e1c3b9687bc0e7d9c05806904424cf46c27981e Mon Sep 17 00:00:00 2001 From: aadit Date: Thu, 28 Aug 2025 12:32:22 +0530 Subject: [PATCH] Add ES/Lab/LAB6/valuelist.c --- ES/Lab/LAB6/valuelist.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ES/Lab/LAB6/valuelist.c diff --git a/ES/Lab/LAB6/valuelist.c b/ES/Lab/LAB6/valuelist.c new file mode 100644 index 0000000..fc4ad7b --- /dev/null +++ b/ES/Lab/LAB6/valuelist.c @@ -0,0 +1,17 @@ +#include + +int main(){ + int i; + // from P2.15 -> P2.22 + LPC_PINCON->PINSEL4 &= 0x3FFFFFFF; // all values except P2.15 are taken as 1 + LPC_PINCON->PINSEL5 &= 0xFFFFC000; // all values except P2.16 (0,1) -> P2.22 (12,13) are taken as 1 + + LPC_GPIO2->FIODIR = 0x007F8000; // all values except 15 -> 22 are taken as 0 (and GPIO2 because it's PIN 2) + + while(1){ + LPC_GPIO2-> FIOSET=0x007F8000; + for(i=0; i<1000; i++); + LPC_GPIO2->FIOCLR=0x007F8000; + for(i=0; i<1000; i++); + } +}