Gordon's example is for a 5x6 array (30 LEDs) so he makes a uint8array 90 bytes long (30 LEDs 3 bytes per LED). The outer loop loops over each of the 5 rows, and the inner loop goes over each LED within those rows, setting the three colors in it. X and Y are the coordinates of the LED it's addressing.
If you only have 8 in a single row, you'd create a 24 byte long uint8array (3 bytes per LED), and you'd want to adjust the two loops appropriately (ie, change the tests to y<1 and x <8 )
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Gordon's example is for a 5x6 array (30 LEDs) so he makes a uint8array 90 bytes long (30 LEDs 3 bytes per LED). The outer loop loops over each of the 5 rows, and the inner loop goes over each LED within those rows, setting the three colors in it. X and Y are the coordinates of the LED it's addressing.
If you only have 8 in a single row, you'd create a 24 byte long uint8array (3 bytes per LED), and you'd want to adjust the two loops appropriately (ie, change the tests to y<1 and x <8 )