Created
November 16, 2012 03:46
-
-
Save xorrbit/4083851 to your computer and use it in GitHub Desktop.
FOR THE DOCTOR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "inc/hw_memmap.h" | |
#include "inc/hw_types.h" | |
#include "driverlib/adc.h" | |
void main(void) { | |
unsigned long ulValue; | |
// | |
// Enable the first sample sequencer to capture the value of channel 0 when | |
// the processor trigger occurs. | |
// | |
ADCSequenceConfigure(ADC0_BASE, 0, ADC_TRIGGER_PROCESSOR, 0); | |
ADCSequenceStepConfigure(ADC0_BASE, 0, 0, | |
ADC_CTL_IE | ADC_CTL_END | ADC_CTL_CH0); | |
ADCSequenceEnable(ADC0_BASE, 0); | |
// | |
// Trigger the sample sequence. | |
// | |
ADCProcessorTrigger(ADC0_BASE, 0); | |
// | |
// Wait until the sample sequence has completed. | |
// | |
while(!ADCIntStatus(ADC0_BASE, 0, false)) | |
{ | |
} | |
// | |
// Read the value from the ADC. | |
// | |
ADCSequenceDataGet(ADC0_BASE, 0, &ulValue); | |
for(;;); // loop forever cause WE COOL LIKE THAT | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment