f

Dependencies:   HCSR04 awali2

Files at this revision

API Documentation at this revision

Comitter:
timilrlan
Date:
Thu May 26 06:11:34 2022 +0000
Parent:
101:bea6b4cfedac
Commit message:
fds

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
diff -r bea6b4cfedac -r 2591f689e242 main.cpp
--- a/main.cpp	Tue Apr 19 07:21:10 2022 +0000
+++ b/main.cpp	Thu May 26 06:11:34 2022 +0000
@@ -5,9 +5,12 @@
 
 //D12 TRIGGER D11 ECHO
 HCSR04 sensor(D12, D11);
-
+DigitalOut rele(D7);
 
-
+if (distance <= 0) {
+        printf("scan() failed with return value: %d\n", count);
+        return 0;
+    }
 #include "MQTTmbed.h"
 
 #include <MQTTClientMbedOs.h>
@@ -138,11 +141,11 @@
 
  data.MQTTVersion = 3;
 
- data.clientID.cstring = "ric-demo-room-device-my";
+ data.clientID.cstring = "mqtt-timirlan_davletshin-6wtths";
 
  data.username.cstring = "111";
 
- data.password.cstring = "1234567";
+ data.password.cstring = "111";
 
  if ((rc = client.connect(data)) != 0)
 
diff -r bea6b4cfedac -r 2591f689e242 mbed_app.json
--- a/mbed_app.json	Tue Apr 19 07:21:10 2022 +0000
+++ b/mbed_app.json	Thu May 26 06:11:34 2022 +0000
@@ -16,8 +16,8 @@
         "*": {
             "target.network-default-interface-type": "WIFI",
             "nsapi.default-wifi-security": "WPA_WPA2",
-            "nsapi.default-wifi-ssid": "\"GalaxyA32\"",
-            "nsapi.default-wifi-password": "\"77777777\"",
+            "nsapi.default-wifi-ssid": "\"AManAtTheEdge\"",
+            "nsapi.default-wifi-password": "\"TTuHrBuH\"",
             "esp8266.tx": "D8",
             "esp8266.rx": "D2",
             "esp8266.socket-bufsize": "1024",