Demo for Mbed Connect Cloud board and an IFTTT integration with Google Sheets
Dependencies: mbed-http C12832
View the tutorial for this demo here.
Diff: working/main_working.h
- Revision:
- 4:0160ae8489f3
- Parent:
- 2:ba90e563a0d0
--- a/working/main_working.h Fri Nov 10 17:44:23 2017 -0600
+++ b/working/main_working.h Fri Nov 10 19:43:06 2017 -0600
@@ -43,7 +43,7 @@
int main() {
// MAIN CODE HERE
-
+
lcd_print("Connecting...");
int ret = wifi.connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
if (ret != 0) {
@@ -55,12 +55,14 @@
button.rise(&button_clicked);
while (true) {
+ // WHILE LOOP CODE HERE
+
if (clicked) {
clicked = false;
char body[140];
char event_name[] = "Button Clicked";
NetworkInterface* net = &wifi;
- HttpRequest* request = new HttpRequest(net, HTTP_POST, "http://maker.ifttt.com/trigger/mbed_connect/with/key/SECRETKEY");
+ HttpRequest* request = new HttpRequest(net, HTTP_POST, "http://maker.ifttt.com/trigger/mbed_connect/with/key/SECRET_KEY_HERE");
request->set_header("Content-Type", "application/json");
sprintf(body, "{\"value1\":\"%s\", \"value2\":\"%d\"}", event_name, count);
HttpResponse* response = request->send(body, strlen(body));
Cambridge Hackathon

