Mihajlo Djordjevic 2020/438

Dependencies:   Adafruit_GFX 19E042PIM_MB_PINS

Files at this revision

API Documentation at this revision

Comitter:
mixidj
Date:
Sat Dec 11 16:19:41 2021 +0000
Parent:
0:3e4e1cfbfd0d
Commit message:
Mihajlo Djordjevic

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Dec 11 10:15:42 2021 +0000
+++ b/main.cpp	Sat Dec 11 16:19:41 2021 +0000
@@ -26,7 +26,8 @@
 I2C i2c_obj(MB_OLED_SDA, MB_OLED_SCL);
 Adafruit_SSD1306_I2c myOLED(i2c_obj, PB_5, I2C_ADD_MBED, OLED_HEIGHT_PX, OLED_WIDTH_PX);
  
-char* topic_sub = "samo-jak-gas";
+char* topic_sub = "subpim05";
+char* topic_pub = "pubpim05";
 const char* hostname = "broker.hivemq.com";
 int port = 1883;
  
@@ -58,11 +59,12 @@
     
     MQTTPacket_connectData data = MQTTPacket_connectData_initializer;
     data.MQTTVersion = 3;
-    data.clientID.cstring = "Zolica";
+    data.clientID.cstring = "miksi";
  
     client.connect(data);
     client.subscribe(topic_sub, MQTT::QOS0, messageArrived);
     
+    
     myOLED.begin();
     i2c_obj.frequency(400000);
     
@@ -72,6 +74,6 @@
     
     while(1) {
         thread_sleep_for(WAIT_MS);
-        client.yield(1000);
+        client.yield(5000);
     }
 }
\ No newline at end of file
--- a/mbed_app.json	Sat Dec 11 10:15:42 2021 +0000
+++ b/mbed_app.json	Sat Dec 11 16:19:41 2021 +0000
@@ -2,11 +2,11 @@
     "config": {
         "wifi-ssid": {
             "help": "WIFI SSID",
-            "value": "\"Zola\""
+            "value": "\"cvele97\""
         },
         "wifi-password": {
             "help": "Wifi Password",
-            "value": "\"zovemearmani\""
+            "value": "\"ekonomskitigar2021\""
         }
     },
     "target_overrides": {