LED tutorial question or two



  • I'm a complete newbie on the Onion, so please be gentle!

    I just set up my Onion (in the expansion dock) and thought I'd give it a test drive. I accessed the Console and used the GPIO tool successfully to toggle port pin 0 on and off. Emboldened by my sense of achievement, I decided to try out the LED tutorial at https://wiki.onion.io/Tutorials/Controlling-RGB-LED and tried the example

    expled 0x1133

    The expansion dock's LED didn't turn the expected pink color, but instead cycled rapidly (maybe every 1/4 second) through various colors. Finally after a minute or so, the color settled on pink.

    Oddly enough, everything seems to be working fine now. What happened?


  • administrators

    @Jeff-Verive
    That's odd...
    Was your command expled 0xf21133 like in the tutorial or expled 0x1133 like from the post?

    My best guess is that it took some time to kill the existing pwm processes that were previously controlling the LED.
    Let us know if the problem persists.


  • administrators

    Ok, I think I've figured out the flicking.

    Since the Expansion Dock LED is controlled by software PWM, the pulse timing cannot be guaranteed when there are processor intensive threads running.

    I just set my LED to pink and when I ran a large-ish program the LED flickered between colours like crazy.



  • Thanks for the reply. The device must indeed have been running some processor-intensive stuff, though I don't know what! I have not yet figured out how to run anything yet, and the device was well past boot-up. Since the thing only acted weird that one time, I'll consider it a fluke.



Looks like your connection to Community was lost, please wait while we try to reconnect.