Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

void loop()

{
DateTime now = RTC.now();
if(now.second() < 05 ){
int it = (int)dht.readTemperature();
int ih = (int)dht.readHumidity();
sprintf( temp, " %uc%u ", it , ih );
printString(temp);
}
if(now.second() > 05 ) {
sprintf( time, "%02hhu:%02hhu:%02hhu", now.hour(), now.minute(), now.secon
d());
printString(time);
}
//delay(300);
}
void printString(char* s)
{
int col = 0;
while (*s != 0)
{
if (*s < 32) continue;
char c = *s - 32;
memcpy_P(buffer, CH + 7*c, 7);
m.writeSprite(col, 0, buffer);
m.setColumn(col + buffer[0], 0);
col += buffer[0] + 1;
s++;
}
}

You might also like