/* Library made by: g4lvanix * Github repository: https://github.com/g4lvanix/I2C-master-lib */ #include #include #include "i2c_master.h" #define F_SCL 400000UL // SCL frequency #define Prescaler 1 #define TWBR_val ((((F_CPU / F_SCL) / Prescaler) - 16 ) / 2) void i2c_init(void) { TWBR = (uint8_t)TWBR_val; } uint8_t i2c_start(uint8_t address) { // reset TWI control register TWCR = 0; // transmit START condition TWCR = (1<