emennie ******************** ********* char i, j, k, n, p, int tiket; char keyold; char command; // komanda ot komputerachar pozin [] = {0}; // nomer zagruz elementaint timedvig; // vremya dgigenia platformuchar uprd56; int p1, p2, p3, p11, p21, p31char adrh, adrl; char din [] = {0,0,0,0,0,0,0,0,0,0};
// ************************* upr byte ************* *********** char dd1, dd2, dd3, dd4, dd5; delay (void chart t0)
{char t1; (t1 = 0; t1
} readwriteI2C (void unsigned char adresh, adresl)
{= 1; = 1; = 0;// impulse START = 0xa0;// I2C prefix adres PZU (readwrite) p = p +1; = 0; (i = 0; i < 8; i + +) // ***************** perdacha prefiksa *********
{(5); = 1; ((p & 1)> 0) sda = 1; = p>> 1; (5); = 1; (10); = 0 ;
} = 1; (sda) // ogidanie otveta PZU
{= 0; (10); = 1; (10);
}; = adrh; // ***************** peredacha starh adresa ******* *** (i = 0; i <8; i + +)
{(5); = 1; ((p & 1)> 0) sda = 1; = p>> 1; (5); = 1; (10); = 0 ;
} = 1; (sda) // ogidanie otveta PZU
{= 0; (10); = 1; (10);
}; = adrl; // ************** peredacha mladhy adresa ********* ( i = 0; i <8; i + +)
{(5); = 1; ((p & 1)> 0) sda = 1; = p>> 1; (5); = 1; (10); = 0 ;
} = 1; (sda) // ogidanie otveta PZU
{= 0; (10); = 1; (10);
};
// ************************ procedua chtenia ************** ********* (readwrite)
{(j = 0; j <10; j + +)
{scl = 0; = 0; (i = 0; i <8; i + +)
{(10); = 1; (sda) p = p | 0x80; = p>> 1; (10); = 0;
} [j] = p; = 0; (10); = 1; (10); = 1;
}// ************************ write blok dannih ************ ********
{(j = 0; j <10; j + +)
{= din [j]; = 0; (i = 0; i <8; i + +)
{(10); = 0; ((p & 1)> 0) sda = 1; = p>> 1; (10); = 1; (10); = 0 ;
} = 0; = 1; (sda) // ogidanie otveta ACK ot PZU
{= 0; (10); = 1; (10);
}
}
// ********************** stop pulse **************** ************* = 0; = 0; = 1; = 1;
}
} uart_interrupt...