-
Electric Imp Code Posted
08/20/2014 at 15:06 • 0 comments8-20-14 Posted the Electric Imp Agent and Device code to the support page for this project. Like all code it will be tweaked and modified over the next few weeks, but this version works so feel free to take a look.
I realized the existing code will keep the RGB LED on 24/7 even though the tennis courts are not open all of the time. This has to be fixed. There are several options. Could have a hardware On-Off switch so the staff can turn it on in the morning when they arrive and turn it off when they leave, but one main feature of this design is that the staff doesn't have to do much so I doubt I'll do this. Could have a photodetector to turn off the unit when it is dark, but this would need a way to set the threshold and some rooms are never completely dark so this might be a problem. The electric imp knows what time it is (or can find it out easily) so I will probably add an option to set the starting time and ending time on the web page and then use those times to control the RGB LED. We can have default values of 6:00 AM and 10:PM (we have lights on the courts and this probably is common) which probably would work for most. Not sure how to do this in the code but that is how this project has developed; find something I want to add and then figure out how to do it.
-
Web Site Snag
08/19/2014 at 22:22 • 0 commentsGot the prototype hardware working nicely and then ran into a snag with the web site code I need. I've been learning a bit about Javascript and JQuery and got enough done to have a working page, shown below.
The Electric Imp Agent code sends a "Open" or "Closed" message to my web page which is shown on the screen, along with the time and the battery voltage. That works great.
I've been learning about how to trap the Open or Closed message and then do more with it (like have the background color be green if the courts are open) but it isn't as simple as I expected (or I just haven't figured it out yet).
Oh well, if it were easy it wouldn't be any fun.
-
Intro Video
08/15/2014 at 15:58 • 0 commentsMade and posted an intro video for this project. I was supposed to play tennis, but got rained out. Karma, I guess.
-
Prototype Breadboard
08/14/2014 at 21:44 • 0 commentsMade a prototype breadboard today. It is essentially two of the sample projects from the Sparkfun Tutorials on Electric Imp mashed together (Example 2 & 3).
https://learn.sparkfun.com/tutorials/electric-imp-breakout-hookup-guide/all
Here is the schematic
When S1 is closed then LED1 will be set to 'Green' and a status update will be sent to the server to be posted on a web page saying the tennis courts are open. If it starts raining then the staff will flip the S1 switch to open, the LED1 will be set to 'Red' and a status update will be sent to the server.
I have ordered parts for the engineering prototype, which primarily are two tennis ball lights, one of which I hope I can make work for this project. The rest of the parts I have here hiding in old projects.
Next I will get the software working, which shouldn't be bad since like the hardware will be based on existing working examples (I know, famous last words).