Project for course Appliance of MCU, School of Electrical engineering, Uni of Belgrade

Dependencies:   19E042PIM_MB_PINS Adafruit_GFX MAX44000 mbed-mqtt

Revision:
1:dbf4e2903500
Parent:
0:cd8f25aaf6d7
Child:
2:4daed4780232
diff -r cd8f25aaf6d7 -r dbf4e2903500 main.cpp
--- a/main.cpp	Mon Jun 20 17:28:54 2022 +0000
+++ b/main.cpp	Mon Jun 20 18:08:19 2022 +0000
@@ -21,6 +21,8 @@
 AnalogIn pot1(MB_POT1);
 // Left button on the motherboard:
 InterruptIn sw1(MB_SW1);
+// LEFT LED on the motherboard:
+DigitalOut led1(MB_LED1);
 // Right LED on the motherboard:
 DigitalOut led2(MB_LED2);
 // Pointer to a WiFi network object:
@@ -34,8 +36,8 @@
 // Message handler:
 MQTT::Message message;
  
-char* topic = "mbed-sample-pub";
-char* topic_sub = "mbed-sample-sub";
+char* topic = "test/Pavle/Pot1";
+char* topic_sub = "test/Olja/Pot1";
 // Counter of arrived messages:
 int arrivedcount = 0;
 // Flag indicating that button is not pressed:
@@ -124,8 +126,9 @@
  
 int main()
 {
+    led1 = 1;
     // Set the interrupt event:
-    sw1.rise(&buttonFunction); 
+    sw1.fall(&buttonFunction); 
     
     // Create a default network interface:
     wifi = WiFiInterface::get_default_instance();