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.
#include<lpc214x.h>
unsigned char temp;
void adc_init(void);
void adc_convert(void);
int main(void)
{
PINSEL0=0x00000300;
PINSEL1 = 0x15000000;
adc_init();
while(1)
{
adc_convert();
if (AD0DR3==0x0136)
{
temp=1;
}
}
}
void adc_init()
{
AD0CR=0x00200E00;
}
void adc_convert()
{
AD0CR = (AD0CR&0xFFFFFF00)|0x04;
AD0CR|=(1 << 24);
while((AD0DR3&0x80000000)==0);
}