New answers tagged

0

store your snake state in a 2d array and handle the logic there: https://www.tutorialspoint.com/arduino/arduino_multi_dimensional_arrays.htm then write a function that accepts the 2d array for turning on the leds. for each move you have to check if there is a border so you have an IF in each direction eg to the right: if (pos<width){ pos+=1; } else { pos=...


2

something that will go through the color wheel until the destination color For that the FastLED library has the function ColorHSV(), which can be used to define colors using the HSV color space. It stands for Hue, Saturation and Value (or brightness). Hue is the value representing the position in the color wheel, so that is what you want to change. Instead ...


2

Currently you are first filling an array with values from a calcuation by going through all LEDs; and then you are again going through all LEDs to actually set them. You can do that in one step. Also your current code will most likely not work, since you just count from zero to the total number of LEDs, but the individual strip doesn't know of that much LEDs....


Top 50 recent answers are included