@GarrettL, line 143 LCD.fillRect(i,0,i+2,10); is obviously where it happens... and what it does is drawing 50 bars (rectangles) of 3x10 pixels - 3 pixels wide, 10 pixels heigh.
The current setup / code takes advantage of the stepping of 3 and makes it 3 wide... depending on the pixels you have in x-axis, you can make it wider... I assume you have a 240x320 display... I though do not know how you orient it: is x-axis (A) 240 pixels, or (b) 320 pixels... It matters, but not really, because you can calculate it...
I suggest you explore your options with these 3 steps:
1st, replace line 143 with these two lines:
LCD.fillRect(x,y,x+xd,y+yd);
x += xi; y += yi;
2nd, insert between line 140 and 141 this line:
var x = 0, y = 0;
3rd, to make everything work, you do some prep work between line 10 and 11 with these lines:
var WX = 240, HY = 320, Orient = "y", xi, yi, xd, yd;
if (Orient === "x") {
xi = Math.floor(WX / (rgb.length / 3)); yi = 0; xd = xi - 1; yd = 29;
} else {
xi = 0; yi = Math.floor(HY / (rgb.length / 3)); xd = 29; yd = yi - 1;
}
The Constant Orient says in which direction - x or y - you want to show the (50) LEDs and is used to calculate how many pixels you can use per LED to fit in one line in - x or y - direction.
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.
@GarrettL, line 143
LCD.fillRect(i,0,i+2,10);
is obviously where it happens... and what it does is drawing 50 bars (rectangles) of 3x10 pixels - 3 pixels wide, 10 pixels heigh.The current setup / code takes advantage of the stepping of 3 and makes it 3 wide... depending on the pixels you have in x-axis, you can make it wider... I assume you have a 240x320 display... I though do not know how you orient it: is x-axis (A) 240 pixels, or (b) 320 pixels... It matters, but not really, because you can calculate it...
I suggest you explore your options with these 3 steps:
1st, replace line 143 with these two lines:
2nd, insert between line 140 and 141 this line:
3rd, to make everything work, you do some prep work between line 10 and 11 with these lines:
The Constant
Orient
says in which direction - x or y - you want to show the (50) LEDs and is used to calculate how many pixels you can use per LED to fit in one line in - x or y - direction.Enjoy!