I have the next (last part) of a arduino code, Now I will have this info on a Oled (0.96 I2C) or a LCD 16x2 , I2c , or a LCD 16x4, I2C
At this moment I have to less program knowledge to do this, who can help me?
code:
void ShowEverything()
{
Serial.println(F( "----------------------------------"));
for( int i=0; i<2; i++)
{
Serial.print(F( "Accu "));
Serial.print( i == 0 ? "A" : "B");
Serial.print(F( " : "));
if( battery_state == WAIT)
Serial.print( "Waiting ");
else if( battery_state == CHARGE)
Serial.print( "Charging");
else
Serial.print( "Error");
// Show the counter in days,hh:mm:ss
int days = (int) (battery_count / (24UL * 60UL * 60UL));
int hours = (int) ((battery_count / (60UL * 60UL)) % 24UL);
int minutes = (int) ((battery_count / (60UL)) % 60UL);
int seconds = (int) (battery_count % 60UL);
// A sprintf with formatting is easer
char buffer[40];
sprintf( buffer, " %d days, %02d:%02d:%02d", days, hours, minutes, seconds);
Serial.print( buffer);
Serial.println();
}