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
/* A simple ADC example that checks the analog reading on ADC0 and turns | |
* an LED on if the reading is higher than a threshold value and turns if | |
* off if it is under that value. */ | |
#include <avr/io.h> | |
#include <stdint.h> | |
/* Which analog pin we want to read from. The pins are labeled "ADC0" | |
* "ADC1" etc on the pinout in the data sheet. In this case ADC_PIN | |
* being 0 means we want to use ADC0. On the ATmega328P this is also | |
* the same as pin PC0 */ |