Avatar for bret

bret

Member since Feb 2014 • Last active Feb 2014
  • 1 conversations
  • 2 comments

Most recent activity

    • 12 comments
    • 5,549 views
  • in JavaScript
    Avatar for bret

    Hi Gordon,

    Thank you for verifying what I was seeing and explaining that there was no debouncing in version 1v50. It would certainly be very useful to make projects more reliable and have a polished, quality feel. As I write this and check out the issue on GitHub, it looks like you've added the functionality. Thank you very much for that. I look forward to trying it out!

    Thanks again for creating and sharing Espruino with the world.

  • in JavaScript
    Avatar for bret

    In another post about the LED and button tutorial, the following was stated:

    setWatch can be called like setWatch(swap_on_down, BTN1,
    {repeat:true,edge:"rising"}); so that it only calls your swap_on_down
    function when the button becomes pressed.

    I used that code but sometimes when I press the button once, my function gets called twice. I thought maybe I was being careless and tried very carefully to press and release it without any hesitation. I found that, no matter how careful I was, sometimes the function would get called once and sometimes 2-3 times. I changed the code to use "falling" instead and it seems to work reliably - the function only gets called once per button press.

    Has anyone else experienced this behavior? Perhaps there is a bug? Is the switch debouncing implemented in hardware or software with Espruino?

Actions