Rev 12 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
/*############################################################################
############################################################################*/
#include "main.h"
//############################################################################
//Init ADC
void ADC_Init(void)
{
ADMUX = 0;
ADCSRA = 0x87;
ADMUX = 0;
ADCSRA |= 0x40; // Start Conversion
}
unsigned int MessAD(unsigned char channel)
{
unsigned int messwert = 0;
ADMUX = channel;
ADCSRA |= 0x10; // Clear Ready-Bit
ADCSRA |= 0x40; // Start Conversion
while (((ADCSRA & 0x10) == 0));
messwert = ADCW;
return(messwert);
}