You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • @JumJum: That'll only work if you're using the version you install from GitHub - not the one from the web store.

    @controlCloud: Ok, I just got the out of memory by tapping the button 5 times very quickly - is that what you did?

    But yes, the code that's produced is async - when you say 'wait 2 seconds' it actually executes the bit inside it after 2 seconds, while executing the next bit down immediately. So what you're doing is immediately asking 20 different digitalWrites to be done after 2 seconds. If you press the button 5 times that's creating 100 different callbacks!

    If you want to flash, then I'd drag the second wait to be inside the first wait. Repeating 10 times is more tricky, but can be done with something like the attached. Obviously if you keep pressing the button it'll have pretty much the same effect and will run out of memory though (however after roughly twice the number of button presses).


    1 Attachment

    • a672084360d1e6e8d49306d09f7dfefed824f7a7.png
About

Avatar for Gordon @Gordon started