• I'm pretty new to coding in general, so please excuse me if I have missed something obvious.

    I am able to turn each of the LEDs on and off using a webpage:


    <button onclick="Puck.write('LED1.set();\n');">o­n</button>
    <button onclick="Puck.write('LED1.reset();\n');"­>off</button>


    <button onclick="Puck.write('LED2.set();\n');">o­n</button>
    <button onclick="Puck.write('LED2.reset();\n');"­>off</button>


    <button onclick="Puck.write('LED3.set();\n');">o­n</button>
    <button onclick="Puck.write('LED3.reset();\n');"­>off</button>

    Nifty. I assume that using PWM or some other technique, I could pass RGB values to the Puck and get any color to display. I built the webpage and have sliders doing all kinds of fancy stuff... but I can't figure out how to send the RBG values to the Puck.

    In other words, instead of on/off, how do I send rgb(80, 128, 199) (which is #50DAC7) to the three LEDs?

    I think that this and this are moving me in the right direction, but I am not a coder and thus can't figure out how to apply it to my problem.

    For anyone curious, what I have so far is attached. Comments are welcome!

    6 Attachments


Avatar for user71469 @user71469 started