/* Function for clocking one data byte out and reads slave acknowledgment. 
Can handle clock stretching. After calling this function SCL is low and SDA low/high depending on the value of LSB of the data byte. SCL is expected to be output and low when entering this function. */
static bool twi_master_clock_byte(uint_fast8_t databyte)
/* Function for clocking one data byte out and reads slave acknowledgment. 
Can handle clock stretching. After calling this function SCL is low and SDA low/high depending on the value of LSB of the data byte. SCL is expected to be output and low when entering this function. */
static bool twi_master_clock_byte(uint_fast8_t databyte)
{
            TWI_SDA_HIGH();
        }
        else
        {
            TWI_SDA_LOW();
        }
        if (!twi_master_wait_while_scl_low())
        {
            transfer_succeeded = false;
            break;
        }
    }
    TWI_SCL_LOW();
    TWI_DELAY();
    TWI_SDA_INPUT();
    TWI_DELAY();
    transfer_succeeded &= twi_master_wait_while_scl_low();
    transfer_succeeded &= !(TWI_SDA_READ());
    TWI_SCL_LOW();
    TWI_DELAY();
    TWI_SDA_OUTPUT();
    return transfer_succeeded;
}