• Hi Im wanting to have a box that shows what the leds are showing how would i do this using project 2?

  • I'm not sure I understand what you want to do... Do you mean a box on the computer screen? How would it show the LED state?

    and what's 'Project 2'?

  • You can actually show more than just the LED's state. Checkout @JumJum's testing (monitoring) feature that is built into Espruino Web IDE (see settings).

  • http://www.espruino.com/Project+2 this is project 2. I want a box or maybe multiple that shows different sections of the led strip and that color stage that it is. Does that clarify better for you?

  • You want a monitor that shows you what the actual LEDs are... for example:

    • you loaded the LED string with following colors RRRG GBBB BYYY YYWW
    • your 'box' should show 'exactly' the same sequence of colors in some way

    I you have a display - such as in the project, you can assign a spot of, for example, 3x3 pixel for each of the LED and when the colors are sent out, you also set the spots with the colors...

    There may be some timing challenges, because that would be quite a lot of code you run through to set the spots on the display. If you go native on the display - sending commands to the display controller - you may overcome this by shifting by one zone and add the new zone at the beginning. The display controller does the shifting very efficient, and you have to set only the new spot. Quite a nice programming challenge...

    If I understood it too literally, you may just give an indicator on the display which of the color has been chosen and all LEDs will eventually blending to. For that you modify the code and highlight that color (put a border around the spot, and of course, clear the one from the previously displayed color). The modification of the code would go into the step() function, a piece after each of these lines:

        colFrom = colTo;
        colTo = cols[(Math.random()*cols.length)|0];
    

    Below first of mentioned lines (and before second one), you clear the marking border for the colFrom (you just draw the rectangle with the colFrom with fillRect(...)).

    Below the second of mentioned lines, you draw a black, white, and again black rectangle on the outermost, second and third outermost dots of the colTo block (drawRect(...)). Choosing nested rectangles highlight clearly which color is blended to next, no matter what the colTo color is and what the surroundings are on the display...

  • Ahh, thanks! that makes a lot more sense!

    It looks like @allObjects has you covered there though :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Project 2 -With a box that shows what the leds are showing?

Posted by Avatar for GarrettL @GarrettL

Actions