Project for course Appliance of MCU, School of Electrical engineering, Uni of Belgrade
Dependencies: 19E042PIM_MB_PINS Adafruit_GFX MAX44000 mbed-mqtt
Diff: main.cpp
- Revision:
- 3:68c83e94576f
- Parent:
- 2:4daed4780232
- Child:
- 4:b08e3f8e89bd
--- a/main.cpp Mon Jun 20 18:27:30 2022 +0000 +++ b/main.cpp Mon Jun 20 20:17:32 2022 +0000 @@ -43,7 +43,7 @@ // Flag indicating that button is not pressed: int button_pressed=0; // HiveMQ broker connectivity information: -const char* hostname = "broker.mqttdashboard.com"; +const char* hostname = "broker.hivemq.com"; int port = 1883; // Returning a string for a provided network encryption: @@ -104,7 +104,7 @@ if ((rc = client.connect(data)) != 0) printf("rc from MQTT connect is %d\n", rc); - if ((rc = client.subscribe(topic_sub, MQTT::QOS2, messageArrived)) != 0) + if ((rc = client.subscribe(topic_sub, MQTT::QOS0, messageArrived)) != 0) printf("rc from MQTT subscribe is %d\n", rc); while (true) { @@ -200,8 +200,7 @@ ++arrivedcount; } -void buttonFunction() { - +void buttonFunction() +{ button_pressed=1; - } \ No newline at end of file