neopixel and threading



  • Hello there,

    This christmas light project of mine turned out to be a great programming challenge also. (And I missed the deadline ofc, maybe next time :D )

    So I am using a neopixel strip, and have different programs/scenes/methods to control the led strip.
    And I thinking a way of changing between the scenes. Right now I have a button, with a press of a button it should go the next scenes. Some schenes are just static, some of them have a varios action in them some shorter, some longer.

    So the my question:
    What should be the best practice for cycling throw these schenes?
    I was thinking about threading, if I push the button I would kill the previous thread and start the next one. But I think there is no threading (with thread.start /.stop) just _thread, which is very limited
    Other idea, is that with every schene method I pass a button parameter, and if I push the button exit from it.
    These are my two idea, can you recommend me a third maybe more practical?



Pycom on Twitter