How to make several menu options with a pushbutton and two RCTIME POTs??
Turnbull2112
Posts: 65
I have a device using a BS2 that performs a few operations and there are some setpoints that need to be adjustable. I have to POTs and caps that are running an RCTIME loop and there is a pushbutton input to the stamp. The stamp also feeds a serial LCD display and I can presently press the button and display a "setpoint" screen that shows the two scaled RCTIME values. Is it possible to represent multiple setpoints with one RCTIME variable by pressing the button one, two or three times to reveal different menus? How do I disassociate the RCTIME value from a direct comparison? Do I write to memory locations? How do I go about this? Thanks,
Comments
I don't understand what you mean by "disassociate the RCTIME value from a direct comparison".
To write your set points to memory, use the WRITE and READ commands to an address, starting at address zero. (The program code works down from address 2047, and data works up from address 0).
I don't mean to distract you from your current question of using the two POTs and button for menu navigation. If that is how you want or need to do it then we can certainly help. I did want to mention that Parallax carries a rotary encoder and, combined with a push button can allow you an almost infinite menu/parameter based system. If you would like some more info on this, please say so, or if you'd like more information on using the pots and RCTIME, please say so. Bear in mind that the encoder would be more responsive and less glitchy.
Assuming only 3 I/O's, then you could use this encoder ... http://www.parallax.com/Portals/0/Downloads/docs/prod/compshop/27804-AbsBinRotaryEndcoder-v1.1.pdf ... and omit the "D" output. This would give you 8 detectable positions, instead of the 16 positions it's capable of.
We also have a quadrature encoder that would only require 2 I/O's and an provide an infinite number of positions. The caveat using a single threaded processor is that if you rotate the shaft too quickly you could miss a position event. ... http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/encoder/List/0/SortField/4/ProductID/681/Default.aspx
Alternatively you could adapt a scheme that uses a single push button. Here is a link that describes how to set the time on a clock using only one button. In the Example a Propeller is used, but this concept could be implemented on any of our micro controllers.
http://forums.parallax.com/showthread.php?123829-DS-1302-Set-Date-and-Time-using-Push-Buttons
Regarding your pots & pushbutton inputs, review Tracy's great info on "one pin, may switches" at the bottom of the page at http://www.emesystems.com/BS2rct.htm
Another possibility is instead of a pot, you use a rotary switch with multiple positions, which taps into a resistor string. Sort of a pot with discrete hard values. Properly used, it can make selection easier than a simple rotary pot. For instance here's a switch at Radio Shack:
http://www.radioshack.com/product/index.jsp?productId=2062536 6-position, 2-pole (2 wipers)
You don't need the two-pole, but that shows whats available at the Shack. A little legwork and you can find a 1-pole, 10 position switch which would work quite nicely.
http://www.surplussales.com/Switches/SWRotaryAll-1.html
http://www.futurlec.com/SwRotary.shtml
DO
HIGH 1
PAUSE 100
RCTIME 1,1,SP
Normal screen
SEROUT 3,33,["RUNNING"]
IF PB1 = 1 for 2 seconds THEN
SEROUT 3,33,["CALIBRATION SCREEN 1",DEC3 SP] 'this setting would be written to EEPROM to be used as a variable for an alarm timer.
IF PB1= 1 for 4 seconds THEN
SEROUT 3,33,["CALIBRATION SCREEN 2"DEC3 SP] 'this setting would be written to another EEPROM addr as a variable but would be adjusted by the same RCTIME variable.
This is what I was trying to ask in the first post about "disassociating" the RCTIME variable "SP" to be used for multiple adjustments. Is this even possible??
Thanks