Den Wert kann man in der Datei asuro.c am Ende der Funktion PollSwitch() finden:
Code:
/* function to read out switches */
unsigned char PollSwitch (void)
{
unsigned int i;
int ec_bak=autoencode;
autoencode=FALSE;
DDRD |= SWITCHES; // Switches as Output
SWITCH_ON; // Output HIGH for measurement
ADMUX = (1 << REFS0) | SWITCH; // AVCC reference with external capacitor
Sleep(10);
ADCSRA |= (1 << ADSC); // Start conversion
while (!(ADCSRA & (1 << ADIF)));// wait for conversion complete
ADCSRA |= (1 << ADIF); // clear ADCIF
i = ADCL + (ADCH << 8);
SWITCH_OFF;
Sleep(5);
autoencode=ec_bak;
//return ((unsigned char) ((( 1024.0/(float)i - 1.0)) * 61.0 + 0.5));
//return ((10240000L/(long)i-10000L)*61L+5000L)/10000;
return ((10240000L/(long)i-10000L)*63L+5000L)/10000;
}
(Aus asuro.c v2.3)
Nach dem Ändern die Datei speichern und das Projekt kompilieren (Make all)
Lesezeichen