You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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 :)

About

Avatar for Gordon @Gordon started