PLUS+1 User Forum

PLUS+1™ Hardware => Displays => Topic started by: Keithang on April 20, 2017, 08:07:35 AM

Title: Button Logic | Math
Post by: Keithang on April 20, 2017, 08:07:35 AM
Hi Guys,

I want to enable a climb of numbers on a display if a button is pressed for longer than 500ms and go up\down in increments of 50. I am battling to get this to work, using the counter currently that only allows for 1 integer increase.

Any help would be appreciated.

Thank you
Title: Re: Button Logic | Math
Post by: Marbek_Elektronik on April 20, 2017, 08:53:16 AM
one solution
Title: Re: Button Logic | Math
Post by: G30RG3 on April 21, 2017, 11:00:11 AM
There are several ways to do this:
 You can use the counter you're using now, divide the input before and multiply the output after the counter,  only symmetrical up and down possible
 You can use the Marbek way,
 Or you create a loop with value connects one on the rising, one on the falling edge of your signal, where you add or subtract the values you want. you'll need to set limits: see Marbeks solution