Drumpad #7 Problems

My code is having problems I’m not sure why it’s not working.
Here’s the pen

Hi,

You have set a interval to call your DrumMachine function every millisecond. Inspect the element with id of “display” and you can see how it toggles between a value and blank. It does not solve everything, but its a start to have a look at.

Keep coding!

Get rid of the setInterval and just call the Display function after each update to the playing variable. Or instead of using a state variable have the Display function take a string as an argument and pass it the name when you call it. In either case, it has to be called every time the display needs to be updated (i.e. after each click or button press).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.