Hello, I have an ATtiny404 that I'm programming in Microchip Studio. I'm trying to learn how to program the Two Wire Interface (TWI) to communicate with another ATtiny404. I've been searching all over the internet to find out how to do it but nothing I've found matches TWI registers of the ATtiny404.
If anyone knows how to program TWI, I would really appreciate some help with this. I'm familiar with the ATtiny404 TWI registers, I just don't know what the code looks like for transmitting/receiving data.
Here is what I have so far with the limited knowledge I have (I know it's wrong):

If anyone knows how to program TWI, I would really appreciate some help with this. I'm familiar with the ATtiny404 TWI registers, I just don't know what the code looks like for transmitting/receiving data.
Here is what I have so far with the limited knowledge I have (I know it's wrong):
