Fully functional code for LÜTR v1.

Dependencies:   PM2_Libary Adafruit_GFX BME680

Files at this revision

API Documentation at this revision

Comitter:
pfammjur
Date:
Wed Apr 21 17:49:23 2021 +0000
Parent:
2:b2b85769134e
Child:
4:8c7176d1447f
Commit message:
Zeit;

Changed in this revision

BME680OLED.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/BME680OLED.cpp	Wed Apr 21 17:10:04 2021 +0000
+++ b/BME680OLED.cpp	Wed Apr 21 17:49:23 2021 +0000
@@ -55,6 +55,7 @@
 void setup(){                                   //Setup wird 1 mal durchlaufen
     thread_sleep_for(1000);                     //Logo Anzeigen lassen
     pc.set_baud(9600);                          //baudrate
+    set_time(1619033310);  // Set RTC time to Wed, 21. April 2021 19:28:30
     oled.clearDisplay();
     oled.drawPixel (10, 10,WHITE);
     oled.display();
@@ -74,10 +75,14 @@
     while(true)
     {
         oled.setTextCursor(0,0);
+        //Zeit
+        time_t seconds = time(NULL);
+        //oled.printf("%s", ctime(&seconds));
+        char buffer[32];
+        strftime(buffer, 32, "%b %d %Y  %H:%M:%S", localtime(&seconds));                //Nur Stunde, Minuten, Sekunden auslesen
+        oled.printf("%s", buffer);
         
-        //Zeit
-        
-        
+        oled.setTextCursor(0,15);
         //BME680
         if (bme680.performReading()) {                                                                          //Sensor auslesen
             oled.printf("Temperatur: %.2f C \r\n",bme680.getTemperature());