Here are some of the code. I need to use " lcd.write(byte(0));" and I need to count the location every time. It's very hard work. is there a simpler way? such as using "sprintf ?? if so, how can I do it? thank you
if(mode==1){
lcd.setCursor(0,0);
lcd.write(byte(0)); //time icon
lcd.setCursor(9,0);
lcd.write(byte(0)); //time icon
lcd.setCursor(11,0);
lcd.print("PigOS");
lcd.setCursor(1,1);
lcd.print("Mode + - OK");
lcd.setCursor(0,1);
lcd.write(byte(5)); //button icon
lcd.setCursor(6,1);
lcd.write(byte(5)); //button icon
lcd.setCursor(9,1);
lcd.write(byte(5)); //button icon
lcd.setCursor(12,1);
lcd.write(byte(5)); //button icon
char timeStamp[8];
sprintf(timeStamp, "%02d:%02d:%02d", HR,MIN,SEC);
lcd.setCursor(1, 0);
lcd.print(timeStamp);
}
if(mode==2){
lcd.setCursor(0,0);
lcd.write(byte(2)); //battery icon
lcd.setCursor(11,0);
lcd.write(byte(2)); //battery icon
lcd.setCursor(1,0);
lcd.print("Discharger");
lcd.setCursor(12,0);
lcd.print("Test");
char shuntRead[14];
sprintf(shuntRead,"%04dmA %04dMah",shuntMa, shuntMah);
lcd.setCursor(1, 1);
lcd.print(shuntRead);
}
if(mode==3){
lcd.clear();
}
got many of them already
byte timeIcon[8] = {
0b11111,
0b10001,
0b01010,
0b00100,
0b00100,
0b01010,
0b10001,
0b11111};
byte tempIcon[8] = {
0b00100,
0b01011,
0b01010,
0b01011,
0b01110,
0b11111,
0b11111,
0b01110};
byte batteryIcon[8] = {
0b01110,
0b11011,
0b10001,
0b11111,
0b10001,
0b11111,
0b10001,
0b11111};
byte settingIcon[8] = {
0b00000,
0b10101,
0b01110,
0b11011,
0b01010,
0b11111,
0b00100,
0b00000};
byte arrowupIcon[8] = {
0b00100,
0b00100,
0b01110,
0b11111,
0b00100,
0b01110,
0b01110,
0b01010};
byte buttonIcon[8] = {
0b00000,
0b11111,
0b10001,
0b10101,
0b10101,
0b10001,
0b11111,
0b00000
};