Skip to content

Commit

Permalink
Merge pull request #16 from grahamplata/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
grahamplata authored Apr 4, 2019
2 parents a7e80b0 + 367ad01 commit 77c2200
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 1 deletion.
Binary file modified UserInterface/NextionEditor/WeatherBuddy.HMI
Binary file not shown.
Binary file modified UserInterface/NextionExports/WeatherBuddy.tft
Binary file not shown.
26 changes: 25 additions & 1 deletion WeatherBuddy/src/WeatherBuddy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions bin/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

particle compile photon --target 1.0.1 WeatherBuddy --saveTo builds/WeatherBuddy.photon.bin
3 changes: 3 additions & 0 deletions bin/dfu-mac
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

stty -f /dev/cu.usbmodem144101 14400
3 changes: 3 additions & 0 deletions bin/flash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

particle flash --usb firmware.bin

0 comments on commit 77c2200

Please sign in to comment.