/* * ATtiny24A-Test.c * * Created: 27.03.2021 13:33:20 * Author : Micha */ #define F_CPU 8000000UL #define I2C_FAST_MODE #include #include #include "USI_I2C_Master.c" volatile int16_t mscounter = 0; int16_t lastSend = 0; ISR(TIM1_COMPA_vect){ ++mscounter; } int main(void){ DDRA = 0; PORTA = 0xFF; DDRB = 0x01; PORTB = 0xFE; I2CinitM(); //Timer1 mscounter TCCR1A = 0; TCCR1B = 0; TCCR1C = 0; //CTC OCR1A TCCR1B |= (1< 1kHz COMPA_vect OCR1A = 125; TIMSK1 = 0; TIMSK1 |= (1< 1000){ lastSend = mscounter; I2Cstart(100, 0); I2Cwrite(&i, 1); I2Cstop(); ++i; } } }