We have designed a cool Arduino-based flow controller for river models we build; they're used for education and research (see http://www.emriver.com
The Arduino code we've written works well and does this (not posted, pretty boring and not that relevant to questions below):
--poll three buttons, two of which are "flow up," and "flow down."
--measure voltage sent to a 12v pump from a separate PWM unit, convert that to flow (there is a strong relationship) and display on an LCD
--send pulse signals to the PWM unit for up and down, i.e. speed up, slow down
--totalize and track water flow; third button and up/downs are used to reset this (with "reset? up=yes, down=no?) functions.
So far, everything's working great!
The next thing is a little tricky. Four steps.
1. Using third "aux" button, enter menu mode (LCD is 16 x 2).
2. Page through perhaps 5 choices for hydrographs (defined below).
3. Choose a hydrograph.
4. Run the hydrograph.
Hydrographs are a measurement of the rise and fall of floods in rivers. Many shapes, the simplest is like slicing a pointy mountain in half--a sharp rise, peak, then fall (here are some examples: http://serc.carleton.edu/images/introgeo/socratic/examples/Hydrograph.jpg
I picture defining the rise and fall with 7 or 8 time and flow value points, i.e. at T1 (millis), set flow to Q1 (we use Q for flow, same as Amps), then at T2, set flow to Q2, etc. T3 might be the peak or highest flow.
Will need to slowly rise/fall to interpolate between those points.
Hydrographs will be from around 3 minutes to maby an hour long.
For our first units we want three buttons only (unit has to be kid and waterproof, very simple and durable). No keypad--if we had that all those parameters could be set.
Advanced users can plug in USB and program/hack and make all the fancy hydrographs they want; we just want five or so generic ones for busy educators.
Any suggestions on
1. Approach for the menu system? I haven't seen a lot on that here, or
2. Calling and running a routine that will run five or more different hydrographs.
Anything on general approach and especially something similar out there would greatly help, thanks.
PS. If you REALLY want to see a hydrograph, here is a complete urban one I captured on video: