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.
[SOLVED] Teensy 'Bounce'
-
- Posts: 3
- Joined: Sat Jul 15, 2017 7:02 pm
- Has thanked: 2 times
[SOLVED] Teensy 'Bounce'
- Attachments
-
- 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.
-
- 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'
In this line:
increase the 10 value. I changed it to 100.
More info: https://www.pjrc.com/teensy/td_libs_Bounce.html
Code: Select all
ret->bounce = new Bounce(pin, 10);
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.
-
- Posts: 3
- Joined: Sat Jul 15, 2017 7:02 pm
- Has thanked: 2 times
Re: Teensy 'Bounce'
Thank you!
I thought that was the value I needed to change but just wanted to check.
I thought that was the value I needed to change but just wanted to check.
-
- Posts: 3
- Joined: Sat Jul 15, 2017 7:02 pm
- Has thanked: 2 times
Who is online
Users browsing this forum: Bing [Bot] and 1 guest