Help on button press variable count display routine please
Posted: Tue Jul 12, 2022 10:03 am
I’m working on a PIC instrumentation measurement design with Flowcode but I am having difficulty on one aspect where I want the user interface to insert two values (a min and a max) into respective variables using an up button and a down button. The display is a simple 20x2 led panel. As the user presses the up button you see the display counting up with each press of the button from 0 to 100. If the button is held down for more than a second or two it scrolls up faster. The down button does the same except the count on the display is decrementing 100 to 0.
Once the user has the correct value between 0 and 100 in the variable and shown on the display, pressing another button (ENTER) moves the code out of the routine to the next routine in my project. I was toying with the idea instead of using a third button for the ENTER command, to press both of the up and down buttons together. That last bit is really down to whether I have room on the panel for a third button.
The thing is, while I know how to create the rest of the project using Flowcode I am stumped at coming up with a Flowcode algorithm for the button-count-display interface. Does anyone know if something similar has been used as an example on the forum and can they point me to where please? I know the solution will be one of those simple routines where I can't see the wood for the trees.
Alternatively if an advanced user could tell me how they would tackle this I would be grateful. Just the steps they would use would do. But please don’t hit me with any assembler routines or lots of c code examples. I really want to achieve this using flowcode blocks as I am treating the project as a Flowcode learning tutorial.
Once the user has the correct value between 0 and 100 in the variable and shown on the display, pressing another button (ENTER) moves the code out of the routine to the next routine in my project. I was toying with the idea instead of using a third button for the ENTER command, to press both of the up and down buttons together. That last bit is really down to whether I have room on the panel for a third button.
The thing is, while I know how to create the rest of the project using Flowcode I am stumped at coming up with a Flowcode algorithm for the button-count-display interface. Does anyone know if something similar has been used as an example on the forum and can they point me to where please? I know the solution will be one of those simple routines where I can't see the wood for the trees.
Alternatively if an advanced user could tell me how they would tackle this I would be grateful. Just the steps they would use would do. But please don’t hit me with any assembler routines or lots of c code examples. I really want to achieve this using flowcode blocks as I am treating the project as a Flowcode learning tutorial.