#include #include // Declare your global variables here void expander(unsigned char adresa, unsigned char data1, unsigned char data2); void main(void) { PORTA=0xFF; DDRA=0xFF; PORTD=0xFF; DDRD=0xFF; // Analog Comparator initialization // Analog Comparator: Off // Analog Comparator Input Capture by Timer/Counter 1: Off ACSR=0x80; SFIOR=0x00; ////////////////////// n a s t a v e n i i 2 c ////////////////////// TWSR=0x00; // pro 60 kHZ TWBR=0x48; // cca 60 kHz =0x7e (pri 16 MHHz) TWAR=0x40; // sl.adrres 20 + 0 TWCR=0x44; // enable TWI + enable ACK /* TWDR - data to transmit TWCR - START/STOP TWSR - 7...3 bity urcuji stav */ /////////////////////////////////////////////////////////////////////// delay_ms(5); expander(0x06,0x00,0x00); delay_ms(5); expander(0x00,0x00,0xFF); while (1) { } } void expander(unsigned char adresa, unsigned char data1, unsigned char data2) { TWCR=(1<