Skip to content

Commit

Permalink
Minor updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
angrytongan committed Aug 5, 2012
1 parent cdd8ba4 commit 2a9fd60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 0 additions & 4 deletions README
Expand Up @@ -63,10 +63,6 @@ serial libraries on read()s; adding some small delays in the serial read()
seemed to tidy these up. Should look at the interrupts, but like I said,
I put this together in a hurry.

The WiFly wakes up independently of the Arduino. You might want to sacrifice
a pin or two to check RTS on the WiFly to be sure it's there before you tell
it to upload.

The Bluetooth bee is put to sleep by manipulating pin 5 on the Seeeduino
Stalker. There is a track you have to cut on the board in order to be able
to do this; read the Stalker specs for details.
Expand Down
9 changes: 6 additions & 3 deletions relay.ino
Expand Up @@ -18,6 +18,9 @@

#define MAX_RETRIES 3

#define SLEEP_SHORT 10
#define SLEEP_LONG 60

unsigned long last_total_kwh;
unsigned long last_spot_ac;
unsigned long last_now;
Expand Down Expand Up @@ -112,18 +115,18 @@ void loop(void) {
if (total_kwh == last_total_kwh &&
spot_ac == last_spot_ac &&
now == last_now) {
sleep_minutes = 60;
sleep_minutes = SLEEP_LONG;
} else {
last_total_kwh = total_kwh;
last_spot_ac = spot_ac;
last_now = now;
sleep_minutes = 10; /* pvoutput default upload is 10 minutes */
sleep_minutes = SLEEP_SHORT; /* pvoutput default upload is 10 minutes */

wifly_init();
wifly_upload_stats(total_kwh, spot_ac, now, tmp102_get());
}
} else {
sleep_minutes = 10;
sleep_minutes = SLEEP_SHORT;
}

wifly_sleep(sleep_minutes); /* put wifly to sleep */
Expand Down

0 comments on commit 2a9fd60

Please sign in to comment.