die interrupts werden doch damit nach beenden des Chirp() wieder aktiviert, oder?
Code: [Ansicht]/** * restores the hardware after using the Ultrasonic module * this function is called automaticly after a Chirp */ void RestoreAsuro(void) { TCCR2 = (1 << WGM20) | (1 << WGM21) | (1 << COM20) | (1 << COM21) | (1 << CS20); OCR2 = 0x91; // duty cycle for 36kHz TIMSK |= (0 << OCIE2); // OCIE2: Timer/Counter2 Output Compare Match Interrupt Enable ADCSRA = (1 << ADEN) | (1 << ADPS2) | (1 << ADPS1); // clk/64 ACSR |= (0 << ACIS1); if(autoencode) { EncoderInit(); } Sleep(1); }