Little-Wire
|
Analog to digital converter functions. More...
Functions | |
void | analog_init (littleWire *lwHandle, unsigned char voltageRef) |
unsigned int | analogRead (littleWire *lwHandle, unsigned char channel) |
Analog to digital converter functions.
void analog_init | ( | littleWire * | lwHandle, |
unsigned char | voltageRef | ||
) |
Initialize the analog module. VREF_VCC is the standard voltage coming from the USB plug
Others are the Attiny's internal voltage references.
lwHandle | littleWire device pointer |
voltageRef | (VREF_VCC , VREF_110mV or VREF_2560mV ) |
Definition at line 205 of file littleWire.c.
unsigned int analogRead | ( | littleWire * | lwHandle, |
unsigned char | channel | ||
) |
Read analog voltage. Analog voltage reading from ADC_PIN3 isn't advised (it is a bit noisy) but supported. Use it at your own risk.
For more about internal temperature sensor, look at the Attiny85 datasheet.
lwHandle | littleWire device pointer |
channel | Source of ADC reading (ADC_PIN2 , ADC_PIN3 or ADC_TEMP_SENS ) |
Definition at line 210 of file littleWire.c.