Longpress detection for mode change

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Hasina
Posts: 1
Joined: Mon Feb 15, 2021 8:28 pm
Contact:

Longpress detection for mode change

Post by Hasina »

I am trying to make a presettable voltmeter. It will show voltage normally. But when it will exceed the SET value an LED will glow. I did it using a TOGGLE switch as MODE CHANGER. I want to ENTER the SET mode by pressing the OK & UP button together for 5 secs.

Other buttons in this program are
One UP button, one DOWN button, and an OK button that writes the SET value into EEPROM.

Please how can I enter into SET mode Longpress and EXIT by pressing the OK button.

Thank you
Attachments
VOLTMETER PRESETTABLE.fcfx
(23.85 KiB) Downloaded 89 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Longpress detection for mode change

Post by medelec35 »

That does look like an assignment?
My suggestion is used a delay loop that looks a the button inputs then exits when buttons are released.
While in the loop have a count macro.
I don't want to give too much away as Teachers regally check these forums.
Martin

Post Reply