Subversion Repositories BL-Ctrl

Rev

Rev 51 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 51 Rev 58
Line 29... Line 29...
29
  ADMUX  =  0x06;  // Kanal 6
29
  ADMUX  =  0x06;  // Kanal 6
30
  ADCSRA |= 0x40;  // Start
30
  ADCSRA |= 0x40;  // Start
31
  while (((ADCSRA & 0x10) == 0));
31
  while (((ADCSRA & 0x10) == 0));
32
  ADMUX = sense;   // zurück auf den Sense-Kanal
32
  ADMUX = sense;   // zurück auf den Sense-Kanal
33
  i = ADCW * 4;
33
  i = ADCW * 4;
34
  if(i > 200) i = 200;
34
//  if(i > 300) i = 300;
35
  Strom = (i + Strom * 7) / 8;
35
  Strom = (i + Strom * 7) / 8;
36
  if (Strom_max < Strom) Strom_max = Strom;
36
  if (Strom_max < Strom) Strom_max = Strom;
37
  ADCSRA = 0x00;  
37
  ADCSRA = 0x00;  
38
  SFIOR = 0x08;  // Analog Comperator ein
38
  SFIOR = 0x08;  // Analog Comperator ein
39
}
39
}