Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DrawDHTtemp() {
- epochTime = timeClient.getEpochTime();
- display.clearDisplay();
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(20, 0);
- display.print("DHT Teplota ");
- display.print(DHTtemp);
- display.println(" C");
- display.drawLine(xl - 2, display.height() - yl, display.width() - 10, display.height() - yl, WHITE); /// Osa X
- display.drawLine(xl , yl, xl, display.height() - yl , WHITE); // Osa Y
- int Xmark = 0 ;
- unsigned long epoch = 0;
- for (int i = 0; i <= 24; i = i + 4) {
- Xmark = xl + 1 + i * 4;
- // Serial.println(Xmark);
- display.drawPixel(Xmark, display.height() - yl - 1, WHITE); // pixel pod oxou X ,každá 4 hodina
- display.drawPixel(Xmark, display.height() - yl + 1, WHITE); // pixel nad osou X ,každá 4 hodina
- display.setCursor(Xmark - 2 , display.height() - 9 );
- epoch = epochTime - (( 24 - i) * 3600 ) ;
- ntp_second = epoch % 60;
- epoch /= 60;
- ntp_minute = epoch % 60;
- epoch /= 60;
- ntp_hour = epoch % 24;
- epoch /= 24;
- display.println(ntp_hour);
- // Serial.print(ntp_hour); Serial.print("hod pro x="); Serial.println(Xmark);
- }
- int Ymark = 0;
- for (int i = 0; i <= 4; i++) {
- Ymark = display.height() - yl - i * 10 - 1 ;
- // Serial.println(Ymark);
- display.drawPixel(xl - 1, Ymark, WHITE); // pixel pod oxou X ,každá 4 hodina
- display.setCursor(0 , Ymark - 4);
- display.print(20 + i * 2 );
- }
- int TimeShift, TempYposition, TempXposition;
- for (int i = DHT_day_temp.size(); i >= 0; i--) {
- ESP.wdtFeed();
- TimeShift = now / 15;
- TempYposition = (display.height() - yl) - ((DHT_day_temp[i] / 0.2) - 100);
- TempXposition = display.width() - 17 - i + TimeShift;
- display.drawPixel(TempXposition , TempYposition , WHITE);
- // Serial.print("Teplota:"); Serial.print(DHT_day_temp[i]); Serial.print("Pro cas T - "); Serial.print(i * 15); Serial.print("min ulozen x = "); Serial.println(TempXposition);
- }
- display.display();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement