diff --git a/UserInterface/NextionEditor/WeatherBuddy.HMI b/UserInterface/NextionEditor/WeatherBuddy.HMI index d666c1a..81d8508 100644 Binary files a/UserInterface/NextionEditor/WeatherBuddy.HMI and b/UserInterface/NextionEditor/WeatherBuddy.HMI differ diff --git a/UserInterface/NextionExports/WeatherBuddy.tft b/UserInterface/NextionExports/WeatherBuddy.tft index 72bef4f..d53e25b 100644 Binary files a/UserInterface/NextionExports/WeatherBuddy.tft and b/UserInterface/NextionExports/WeatherBuddy.tft differ diff --git a/WeatherBuddy/src/WeatherBuddy.ino b/WeatherBuddy/src/WeatherBuddy.ino index 4e4af98..ecd8708 100644 --- a/WeatherBuddy/src/WeatherBuddy.ino +++ b/WeatherBuddy/src/WeatherBuddy.ino @@ -19,19 +19,43 @@ NexText textLocation(0, 5, "textLocation"); int temperatureLow = 0; int temperatureHigh = 0; int temperature = 0; -float humidity = 0; char buffer[100] = {0}; +NexTouch *nex_Listen_List[] = +{ + &textLow, + &textHigh, + &textTemp, + NULL +}; + + +void textTempPopCallback(void *ptr) { + NexText *text = (NexText *)ptr; + memset(buffer, 0, sizeof(buffer)); + text->getText(buffer, sizeof(buffer)); + if (strcmp(buffer,"ON")) { + digitalWrite(9, HIGH); + strcpy(buffer, "ON"); + } else { + digitalWrite(9, LOW); + strcpy(buffer, "OFF"); + } + text->setText(buffer); +} + // Put initialization like pinMode and begin functions here. void setup(void) { nexInit(); // Set the baudrate which is for debug and communicate with Nextion screen. + textTemp.attachPop(textTempPopCallback, &textTemp); Time.zone(-5); // Set Time Zone to EST } // loop() runs over and over again, as quickly as it can execute. void loop(void) { // The core of your code will likely live here. + nexLoop(nex_Listen_List); } String getTime() { diff --git a/bin/build b/bin/build new file mode 100755 index 0000000..16b855f --- /dev/null +++ b/bin/build @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +particle compile photon --target 1.0.1 WeatherBuddy --saveTo builds/WeatherBuddy.photon.bin \ No newline at end of file diff --git a/bin/dfu-mac b/bin/dfu-mac new file mode 100755 index 0000000..7e8a571 --- /dev/null +++ b/bin/dfu-mac @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +stty -f /dev/cu.usbmodem144101 14400 \ No newline at end of file diff --git a/bin/flash b/bin/flash new file mode 100755 index 0000000..d074e94 --- /dev/null +++ b/bin/flash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +particle flash --usb firmware.bin \ No newline at end of file