Download library here.

Check the tutorial page for an explanation about ADC. This program reads ADC channel 5 and saves the value in a variable.


ADC READ

#include "lpc17xx.h"
#include "lpc_types.h"
#include "adc.h"

uint32_t  variable = 0;				//Declare variable to save ADC value

int main (void)
{
    ADCInit(ADC_CLK);				//Initialize ADC ports

    while(1)
    {
          variable = ADCRead(5);	//Read ADC channel 5
    }
}

 

Copyright 2011. Joomla 1.7 templates - Joomla template maker. The Simplecortex is developed by BRC-Electronics