adc works

This commit is contained in:
Christoph J. Scherr 2023-12-09 14:29:29 +01:00
parent 545af2648e
commit 467ebb3e9c
2 changed files with 5 additions and 4 deletions

View File

@ -5,7 +5,7 @@
#include <util/delay.h> #include <util/delay.h>
void adc_init() { void adc_init() {
//DDRA=0x0; // does not exist but is default? DDRC=0x0; // does not exist but is default?
ADCSRA = (1<<ADEN)|(1<<ADPS1)|(1<<ADPS2); ADCSRA = (1<<ADEN)|(1<<ADPS1)|(1<<ADPS2);
ADMUX = (1<<REFS0); ADMUX = (1<<REFS0);
} }

View File

@ -14,10 +14,11 @@
int main (void) int main (void)
{ {
uart_init(); uart_init();
adc_init();
sei(); sei();
char buf[10]; char buf[10];
int sensor[2]; uint16_t sensor[2] = { 0, 1 };
while (1) while (1)
{ {