All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vexanalog.c File Reference

Analog port driver. More...

#include "ch.h"
#include "hal.h"
#include "vex.h"

Macros

#define ADC_CH_NUM   8
 

Functions

void vexAdcInit ()
 Initialize the ADC1 sub system. More...
 
int16_t vexAdcGet (int16_t index)
 Return ADC sample from sample buffer. More...
 
void vexAdcDebug (vexStream *chp, int argc, char *argv[])
 Dump all analog values to console for debug. More...
 

Detailed Description

Analog port driver.

Macro Definition Documentation

#define ADC_CH_NUM   8

Function Documentation

void vexAdcInit ( void  )

Initialize the ADC1 sub system.

int16_t vexAdcGet ( int16_t  index)

Return ADC sample from sample buffer.

Parameters
[in]indexThe index of the adc channel (0 through 7)
Returns
The ADC value in the range 0 to 4095
Examples:
clawbot.c, and vexdefault.c.
void vexAdcDebug ( vexStream chp,
int  argc,
char *  argv[] 
)

Dump all analog values to console for debug.

Parameters
[in]chpA pointer to a vexStream object
[in]argcThe number of command line arguments
[in]argvAn array of pointers to the command line args