I'm not sure why you'd get 'noise' when the button isn't pressed unless there was a short somewhere (are you able to check and see if the pulldown actually worked?).
With only a 10ms debounce you'd definitely expect some bouncing to occur when the button was pressed though - I'd probably suggest 50ms as a good number.
While your code will work, it'll mean that the CPU isn't able to sleep and save power. While not a problem on the F4DISCOVERY (the board is power-hungry anyway!) I wouldn't recommend using the code on something where you care about power consumption :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm not sure why you'd get 'noise' when the button isn't pressed unless there was a short somewhere (are you able to check and see if the pulldown actually worked?).
With only a 10ms debounce you'd definitely expect some bouncing to occur when the button was pressed though - I'd probably suggest 50ms as a good number.
While your code will work, it'll mean that the CPU isn't able to sleep and save power. While not a problem on the F4DISCOVERY (the board is power-hungry anyway!) I wouldn't recommend using the code on something where you care about power consumption :)