Page 1 of 1

Problems setting up setup

Posted: Fri Dec 07, 2018 9:57 am
by Oderlando
Hi. I'm having a little problems with a flowchart I set up. I believe someone can help me fix it. This is a SetPoint that I'm slowly developing. It works as follows: Setpoint starts with initial zero value. When the A1 input is activated for at least 2 seconds, the Setup mode is activated. A led signals active setup via port C0. Once the Button_Up or Button_Down buttons are pressed, add or subtract 1 to the value of the "Count" variable. If any of these buttons are continuously pressed, successive increments or decrements will be made while the button is being pressed. To deactivate the Setup mode, the A1 input is restarted for at least 2 seconds.
The "Count" value is shown in a display.
Some problems I encountered:
1 - If the "Button_Up" or "Button_Down" control buttons are pressed too fast, the program locks.
2 - When any of these buttons is pressed continuously, the program locks, not obtaining the desired effect.
I am sending the code attached.

Re: Problems setting up setup

Posted: Fri Dec 07, 2018 11:22 am
by Benj
Hello,

You have loops for while button down and while button up but inside the loops you are not refreshing the Button_Down and Button_Up variables.

You just need to copy the input icons inside the loops.

Re: Problems setting up setup

Posted: Fri Dec 07, 2018 4:24 pm
by Oderlando
It did not occur to me that I was not reading the door during the loop. Thank you very much. I was able to fix this quickly.