[SOLVED] Teensy 'Bounce'

Having trouble with your GBZ build? Ask your questions here!
Post Reply
FrenchPaul
Posts: 3
Joined: Sat Jul 15, 2017 7:02 pm
Has thanked: 2 times

[SOLVED] Teensy 'Bounce'

Post by FrenchPaul » Sat Nov 04, 2017 4:21 am

I have just finished my first GBZero build, but am having a small problem with the Teensy controller.

Sometimes when I press a button it registers as more than 1 press. Sometimes 2 or 3.
I have read on another thread that it helps to adjust the bounce value in Wermys code but unfortunately I don't know much about Arduino coding!
Can anyone tell me exactly which value I need to increase please?

Any help would be appreciated.
Below is a snapshot of Wermys code that i'm using, it mentions Bounce a couple of times but i'm not sure which value I need to increase.

Thanks.
Attachments
Capture.PNG
Capture.PNG (7.37 KiB) Viewed 4089 times
Last edited by FrenchPaul on Sat Nov 04, 2017 9:29 am, edited 1 time in total.

snoek09
Posts: 145
Joined: Sat May 20, 2017 3:06 am
Location: Amsterdam, The Netherlands
Has thanked: 48 times
Been thanked: 43 times

Re: Teensy 'Bounce'

Post by snoek09 » Sat Nov 04, 2017 4:39 am

In this line:

Code: Select all

ret->bounce = new Bounce(pin, 10);
increase the 10 value. I changed it to 100.

More info: https://www.pjrc.com/teensy/td_libs_Bounce.html
Bounce myButton = Bounce(pin, milliseconds);

Create a Bounce object called myButton, using "pin" and waiting for bouncing to end within "milliseconds" time.

FrenchPaul
Posts: 3
Joined: Sat Jul 15, 2017 7:02 pm
Has thanked: 2 times

Re: Teensy 'Bounce'

Post by FrenchPaul » Sat Nov 04, 2017 5:04 am

Thank you!
I thought that was the value I needed to change but just wanted to check.

FrenchPaul
Posts: 3
Joined: Sat Jul 15, 2017 7:02 pm
Has thanked: 2 times

Re: Teensy 'Bounce'

Post by FrenchPaul » Sat Nov 04, 2017 6:14 am

Thanks snoek09, just tried and it's now working perfectly!

User avatar
YaYa
Posts: 1719
Joined: Mon Jun 26, 2017 12:42 pm
Location: brittany - France
Has thanked: 871 times
Been thanked: 689 times
Contact:

Re: Teensy 'Bounce'

Post by YaYa » Sat Nov 04, 2017 7:18 am

Don’t forget to put [solved] on the topic’s title
Follow me on instagram Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest