This program demonstrates the usage of the ADC. Program sets pin P1.31 as an ADC chanel 5 input to which we connect the potentiometer. Program then turns on an embedded LED on the LPC4088 QSB when the potentiometer's digital value exceeds the middle value.
Dependencies: mbed
Diff: LPC4088-adc.h
- Revision:
- 0:3b7f012600ec
diff -r 000000000000 -r 3b7f012600ec LPC4088-adc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LPC4088-adc.h Sat May 02 17:33:44 2015 +0000 @@ -0,0 +1,17 @@ +//register definitions for ADC peripheral + +#define CR (*((volatile unsigned int *) 0x40034000)) +#define GDR (*((volatile unsigned int *) 0x40034004)) +#define INTEN (*((volatile unsigned int *) 0x4003400C)) + +#define DR0 (*((volatile unsigned int *) 0x40034010)) +#define DR1 (*((volatile unsigned int *) 0x40034014)) +#define DR2 (*((volatile unsigned int *) 0x40034018)) +#define DR3 (*((volatile unsigned int *) 0x4003401C)) +#define DR4 (*((volatile unsigned int *) 0x40034020)) +#define DR5 (*((volatile unsigned int *) 0x40034024)) +#define DR6 (*((volatile unsigned int *) 0x40034028)) +#define DR7 (*((volatile unsigned int *) 0x4003402C)) + +#define STAT (*((volatile unsigned int *) 0x40034030)) +#define TRM (*((volatile unsigned int *) 0x40034034)) \ No newline at end of file