analog.h File Reference

Analog Inputs. More...


Defines

#define ANALOG_MAX   1023
 Maximum value for an analog reading.

Functions

uint16_t analog_read (uint8_t port)

Detailed Description

The Happyboard has 16 analog inputs. These inputs are fed into a 10 Bit ADC. The ADC communicates with the main processor via SPI, and can do so at 500kHz (20k samples per second.) In reality the actual maximum sample rate is slightly lower due to overheads in the OS code. (Also, the bottleneck analog input sampling is usually processing code, rather than the actual data acquisition).

The analog, digital, and encoder inputs (as well as the LCD) are run off a separate 5V regulated supply. This supply can supply up to 400mA to power the input sensors.


Function Documentation

uint16_t analog_read ( uint8_t  port  ) 

Read an analog port value.

Parameters:
port port number to read (8..23).
Returns:
Value read by the analog port (0..1023)