Schau mal hier:

http://www.mikrocontroller.net/articles/Entprellung

Und was meinst du mit dem flackern?