here's the working code
Code:
void fc_i2c_erase_all2()
{ int i, j; int progression = 0;
short int addrH, addrL;
char affiche[10], affiche2[10], affiche3[10], affiche4[10];
for (i = 1; i <= 16; i++) //
{ for (j = 0; j < 2048; j++) //
{ addrH = progression / 256; //
addrL = progression % 256; //
ShortToHex(addrH, affiche);
Lcd_Out(1,1,affiche); // hex address hi
ShortToHex(addrL, affiche2);
Lcd_Out(1,3,affiche2); // hex address lo
IntToStr(progression, affiche3);
Lcd_Out(1,5,affiche3); // decimal address
IntToStr(progression/327,affiche4); // percentage
Lcd_Out(1,10,affiche4);
fc_i2c_write(addrH, addrL, 0x00); //
progression++; //
} //
Lcd_Chr(2, i, 0xFF); // bargraph char
}
Delay_ms(222222500); //
}
Last edited: