Debounce

Implemented digital pin debounce based on this . It puts in a 50 ms wait after a state change on a digital line.  Needs testing. 

It should help with encoders, bumpers, and other bouncy switches although remember boys & girls, you should always try to clean your signal at the source :)

Digital Trigger Only

When selected an polling a line an event is raised only when the state changes.  Encoders & bumpers would be better served using this selection. Typically this promote less chatty communication.

DancesWithRobots

11 years 2 months ago

Here's a quick and dirty counter Greg did in Python to test the bumper switch debouncer.

bumperPin=5
arduino = Runtime.createAndStart("arduino","Arduino")
arduino.digitalReadPollingStart(bumperPin)

def input():
    print 'new pin data '
    print 'pin data is ',
    msg_arduino_publishPin.data[0]

GroG

11 years 2 months ago

Here's the latest - debounce off and trigger on - with me moving a bouncy wire from 5v->gnd->5v-> etc...

GroG

11 years 2 months ago

Woohoo - debounced & triggered - dat'z the shiznit !