
Originally Posted by
ThePearl
Hi there!
I'm trying to create a check that checks with name+number. Let's say I've got a 4x5 pixel setup, and every pixel is named Pixel1 Pixel2 etc. up to Pixel20.
Now what I want to do is I want Pixel1 to glow, and when you hit the right button I want Pixel+1 to start glowing, with other words, Pixel2, and when I hit it again I want Pixel+1 (Pixel3) to start glowing, etc. Is this possible? In some programming languages I know that you could do like.. pixel+"1" or "pixel+1" but I don't know how to do it in expression?
Oh, and E1 or E2 doesn't matter. Help would be appreciated!
It certainly is possible, but I'm not sure how to best approach the idea.
The "problem" is that there is really no way of avoiding having 20 outputs, one for each light.
There is no possibility of dynamically addressing outputs in E2 (or E1).
But here you have a starting point, unless I did something wrong, this will start out black, and, when when you press the button connected to Right, it will go "black > P1 > P2 > P3 > P4 > black" (one step for each press).
Code:
@inputs Right
@outputs Pixel1 Pixel2 Pixel3 Pixel4
@persist Pos
if(~Right & Right) { Pos++ }
Pixel1 = (Pos == 1)
Pixel2 = (Pos == 2)
Pixel3 = (Pos == 3)
Pixel4 = (Pos == 4) Not perfect, not complete, but it's a starting point.
Not sure how much help you want or exactly what you are trying to achieve.
Just ask if you need more help.
(That code was E2 btw)
Bookmarks