Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hay
In 8051 pins are bit addressable using sbit (Keil-C51) so I can declare input switch & out put LED as
Ex:
#include <REG51.H>
sbit SWITCH P1^1
sbit LED P1^4
How to declare the input switch & out put LED in LPC2114 using Keil-ARM
Regards
chandu
Hay
I am switching LED on & off using following code
#include"LPC210x.H"
#define LED1 0x00000800 //LED connected to the P0.11
#define LED2 0x00000400 //LED connected to the P0.10
void main()
{
IODIR=0xFFFFFFFF;
while(1)
{
delay();
IOSET=LED1;
delay();
IOCLR=LED1;
delay();
IOSET=LED2;
delay();
IOCLR=LED2;
}
}
I have seen some different code in the INTERNET
IOSET_bit.P0_11 = 1; //set P0.11t to 1
IOSET_bit.P0_10 = 1; // set P0.10t to 1
IO0CLR_bit.P0_11 = 1; //set P0.11t to 0
IO0CLR_bit.P0_10 = 1; //set P0.10t to 0
How this code will work
In the #include"LPC210x.H” file all the registers are the 32 bit register addressable
Regards
chandu