Hi this is my first time posting, i loooked through about 12 pages of topics looking for something that adressed this… if it is available please rederict me to it with my heartfelt appologies… if not please help out a newbie…
I want my imp to check on my rain water tank’s level and send me a full, halffull or empty message. That was very easy to do thanks to the awesome help from the sparkfun tutorials (here https://learn.sparkfun.com/tutorials/electric-imp-breakout-hookup-guide example 3 Web response using 2 buoys and input pins 8 and 9) sending a nice JSON message to my agent url webpage.
Once I have this information if it is a sunny day I want to water my plants. I do this by turning on a waterpump connected to a rellay conected to a 3.3-5v level shifter connected to the 5 pin on my imp. If it is raining then i do nothing. This was also a breeze thanks again to the imps own tutorials. The led turning on program…( Getting Started: Agents and Internet apps https://electricimp.com/docs/gettingstarted/agents/ ) Flawless!!!
I made an app in appinventor that would generate the "Turn the LED5 on by browsing to " + http.agenturl() + “?led5=1” command code at the touch of a button. I then made a separate app that would read the JSON information and figure using input pins 8 and 9 and their inputs 00,01,10,11 of the inputs to decide if my water tank was actually full, half full, or close to empty …tied this information to 4 pictures of said watertank in each state… and boom watertank viewer/pump app!!
Ran each set of programs independently and got great results…
combined them and it was not so cool anymore…
For one I realized I needed two http:onrequest() handlers which i now know to be a nono… So I looked at all the stuff on sparkfun and in adafruit, and here, and the wiki and this is never touched… Devices in all exampleas are all sensors… or all outputs… so here I am requiring a bit of each.
There that is my story, i uploaded my code which is not mine, just snippets i took from aother programs (i think I owe several guys beers) once i realized what they were supposed to do, just threw them and they worked…oon their own at least…
Any help would be appreciated, and if you happen to be in the Republic of Panama during lemon season you can have as many as you want from any of the trees close to the pumps.
Beto