#include #include "usart.h" #include "i2c.h" void i2cInit(long cpuf, long sclf){ TWSR = 0x00; // no prescaler //SCLF = CPU_F /(16+ (2(TWBR))) -4^TWPS , where SCLF is the clock frequency of the SCL SDA lines, 1000000 or 4000000, // so to calculate twbr, solve for it... We can get rid of "-4^TWPS", as no prescaler is involved TWBR = (((cpuf/sclf)-16)/2); } int i2cStart(char address){ TWCR = (1<