Lee's Feature Complete PDE

Share you PDE file with our community
User avatar
Posts: 5347
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Mar 23, 2013 11:11 am
And what will trigger the refresh if I don't switch screens?
User avatar
Posts: 5347
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Mar 23, 2013 11:19 am
Nevermind..

Posts: 267
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA
PostPosted: Sat Mar 23, 2013 11:28 am
lnevo wrote:Nevermind..

You can't leave me hanging like that! What was the problem and fix?
User avatar
Posts: 5347
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Mar 23, 2013 11:35 am
I still am drawing the graph on DrawCustomGraph()
User avatar
Posts: 5347
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Mar 23, 2013 11:37 am
I currently have screen 0 as my graph, screen 1 is ato and rf status, screen 3 is sun/moon info :)

Posts: 267
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA
PostPosted: Sat Mar 23, 2013 11:57 am
Very cool. I'll let you get it all sorted and out check back later today. Then I'll copy your code :)
User avatar
Posts: 5347
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Mar 23, 2013 12:34 pm
Its posted and working :)
User avatar
Posts: 5347
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Mar 29, 2013 11:34 am
So I did a lot of cleaning up :) I haven't yet compiled or uploaded anything so for now this post is just a preview of what's to come.

First off, I cleaned up a lot of the functions. The only global variables I have are basically the vortech varialbes and my Tide and SunLocation classes. The big benefit is that most of my functions are 100% self-contained and can be copied pretty easily. My setup() custom code is now like 3 lines and my loop() is also extremely clean as everything has been moved to subroutines.

I have also moved a lot of stuff into memory locations. I really need to make this standard practice so that nothing needs to be hard-coded. To support that, I wrote my own init_memory function so that I could re-arrange the variables, make sure new ones are initialized properly, etc. I'm using memory location 199 as the flag bit to trigger the memory reset. I only run this in setup() so you'll have to flip the flag and reboot the controller. Or flip the flag and upload new code. I also changed a lot of the memory locations and variables to use true/false instead of 1=on 0=off, since it cleans up a lot of code. One of the reasons I needed the init_memory function :)

So, what else is new in the coming version? I've added a few things

1) CalibrateDosingPumps() - I wrote this function as I'm about to finally enable my dosers. You flip the memory bit to true and it will turn on both pumps for 10 minutes. Then you can measure how much fluid was pumped and set your pumps accordingly. It will get used once in a blue moon, but hopefully someone will find it useful.

2) runSwabbie() - This function will run my swabbie (using the DosingPumpRepeat() function but I also added a "manual" mode. If you override the default status of the swabbie port, it will clear the override and run the swabbie for 1 minute. Will be fun to demo for people :)

3) runFeeder() - This uses a memory location as a trigger, but basically will StartFeedingMode() and then wait for a specified delay (stored in memory) and then "press" the auto-feeder button for 5 seconds. I have integrated it into my vacation() mode by flipping on the memory location at 7pm when vacation is enabled. I may change the behavior later on after I get my auto-feeder and mod it and I decide I want it running daily :)

That's it for now. I'll probably have some time this weekend to debug the code (written with Textastic on my iPad) and get it uploaded to the controller. My swabbie is going to be a while and I'm waiting for a bracket for the dosing pumps so still some hardware pending :)

Posts: 12225
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Mar 29, 2013 11:41 am
Hey Lee,
This actually triggered a very nice idea :)
I'm going to create a handful of function calls that can be triggered using the wifi commands.
Just like /mf that starts feeding mode.
This way, you can call custom functions through the web browser and we harass Curt to implement in the app too :)
By having those function calls, you can start CalibrateDosingPumps() or runSwabbie() for example without having to trigger it through memory bit set.
Roberto.
User avatar
Posts: 5347
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Mar 29, 2013 11:50 am
Sounds good :) I'm all about saving writes to memory locations :) i should consolidate some though...its kind of a waste of a byte when you only need a bit...anyway off-track :)

What i wanted to share was however we call the function or memory. It's still a http call. I've made myself a bit of a "control panel" html page with all the links I use as shortcuts. Basically a glorified bookmark page. This way I never need to remember what bit to flip :)
PreviousNext

Return to My PDE/INO file

Who is online

Users browsing this forum: No registered users and 2 guests

cron