ATtiny85 Template Code
Code snippets for the ATtiny85
|
Go to the source code of this file.
Functions | |
void | adcInit (ANALOG adc) |
uint16_t | adcRead (ANALOG adc, uint8_t skip, uint8_t average) |
void adcInit | ( | ANALOG | adc | ) |
Initialise the specified analog pin
This function initialises the ADC accessory as well as setting up the input pin attached to the ADC. The set up uses VCC as the reference voltage. If you need to change this do so after initialising all the ADC inputs you want to use.
adc | the ADC input to initialise. |
uint16_t adcRead | ( | ANALOG | adc, |
uint8_t | skip, | ||
uint8_t | average | ||
) |
Read a value from the analog input
Read a 10 bit value from the specified input with option input skipping and averaging.
adc | the ADC input to read |
skip | the number of samples to skip (read and ignore). |
average | the number of samples to average (must be >= 1) |