Skip to content
Browse files

Minor updates.

  • Loading branch information...
1 parent cdd8ba4 commit 2a9fd606281eca0300948662ac7ac300083b5f3c @angrytongan committed Aug 5, 2012
Showing with 6 additions and 7 deletions.
  1. +0 −4 README
  2. +6 −3 relay.ino
View
4 README
@@ -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.
View
9 relay.ino
@@ -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;
@@ -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 */

0 comments on commit 2a9fd60

Please sign in to comment.
Something went wrong with that request. Please try again.