Using an Integer array to hold brightness data



1) Give a description of the problem
I made an integer list/array, but I am unable to reference the values I need

2) What is the expected behaviour?
The expression always returns 0, but I would like the brightness from the array

3) What is happening/not happening?
Apparently, I don’t understand arrays.

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full


Arrays containing numbers are usually written like this:

Maybe something like this:

(Set level confirmed to work as intended)


Thank you! :grinning:

No concise way to initialize the array like in the comment?

Oh, and why the phantom set variable statement at the end of the piston? It editable, but stays gray and doesn’t seem to do anything if modified.


The phantom code was used during testing… I disabled that block, but did not delete it.
(not visible in the jpeg above)

As far as condensing code… I often use math (without arrays) to achieve this… I decide on a low, a high, and then another low… as well as what times are what… My mathematical algorithm can dynamically determine what temp at which time.


OK. Gotcha. So can you initialize the array in the declaration, or no?

I’m working on an algorithm that could work for me. The numbers I plugged in are close to what I want, but a little random. Math would allow and even smoother “curve”.


Super cool… TIL that you can disable code blocks under Edit / advanced options!


You can also select a block (left click to the right of the text) and then disable in the top right.


It turns the block grey, and that code will not be executed.
(although it does take up space towards the max piston size)


Amazing how things like that can escape notice.