At least you are missing one piece. I've colored it red.MrBiek wrote:Hey guys i have been trying to do basically the same thing. My code however doesn't seem to want to work:
static final int displays[][] = new int[][] {
{0,18,12} // Screen 0, 18 LEDs across, 12 LEDs down
//};
And again
static final int leds[][] = new int[][] {
{0,6,11}, {0,5,11}, {0,4,11}, {0,3,11}, {0,2,11}, {0,1,11}, {0,0,11}, // Bottom edge, left half <-
{0,0,10}, {0,0,9}, {0,0,8}, {0,0,7}, {0,0,6}, {0,0,5}, {0,0,4}, {0,0,3}, {0,0,2}, {0,0,1}, // Left edge
{0,0,0}, {0,1,0}, {0,2,0}, {0,3,0}, {0,4,0}, {0,5,0}, {0,6,0}, {0,7,0}, {0,8,0}, // Top edge
{0,9,0}, {0,10,0}, {0,11,0}, {0,12,0}, {0,13,0}, {0,14,0}, {0,15,0}, {0,16,0}, {0,17,0}, // More top edge
{0,17,1}, {0,17,2}, {0,17,3}, {0,17,4}, {0,17,5}, {0,17,6}, {0,17,7}, {0,17,8}, {0,17,9}, {0,17,10}, // Right edge
{0,17,11}, {0,16,11}, {0,15,11}, {0,14,11}, {0,13,11}, {0,12,11} // Bottom edge, right half
};
i keep getting a syntax error on the line with the arrow added in. it keeps asking for a semi colon.
I am really new so i don't quite understand the processing language. i am looking into Lightpack as well, buts its hard to get the hardware
Adalight Reloaded: Super Elite Chuck Norris Edition!
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 15
- Joined: Fri Oct 28, 2011 12:05 pm
Re: Adalight Reloaded: Super Elite Chuck Norris Edition!
- jadonv
- Posts: 23
- Joined: Sat Jun 16, 2012 1:52 pm
Re: Adalight Reloaded: Super Elite Chuck Norris Edition!
does any one feel like pasting a link to their pde? I am so lost when it comes to coding! thanks in advance mines 15 across 10 down but im not going to be picky im sure any others will look fine.
- jadonv
- Posts: 23
- Joined: Sat Jun 16, 2012 1:52 pm
Re: Adalight Reloaded: Super Elite Chuck Norris Edition!
never mind got it working thanks!
-
- Posts: 3
- Joined: Wed Jul 16, 2014 5:33 pm
Re: Adalight Reloaded: Super Elite Chuck Norris Edition!
Just recently purchased the adalight kit with 75 pixels. I have added all the coding but I am getting an error message saying "Arrayindexoutofboundsexception:2190722" as well in the processing software box i am getting a highlighted code " c = pxls[offs[o]];".
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Adalight Reloaded: Super Elite Chuck Norris Edition!
Can you copy-and-paste your displays[][] and leds[][] arrays here (using the code tag button)?
Usually it's just a number that's out of range, or too few or too many items in the leds array. I'll look it over.
Usually it's just a number that's out of range, or too few or too many items in the leds array. I'll look it over.
-
- Posts: 3
- Joined: Wed Jul 16, 2014 5:33 pm
Re: Adalight Reloaded: Super Elite Chuck Norris Edition!
So far I have this set up but the bottom has the missing pixel
static final int displays[][] = new int[][] {
{0,20,19} // Screen 0, 20 LEDs across, 19 LEDs down
static final int leds[][] = new int[][] {
{0,9,19}, {0,8,19}, {0,7,19}, {0,6,19}, {0,5,19}, {0,4,19}, {0,3,19}, {0,2,19}, {0,1,19}, {0,0,19},// Bottom edge, left half
{0,0,19}, {0,0,18}, {0,0,17}, {0,0,16}, {0,0,15}, {0,0,14}, {0,0,13}, {0,0,12}, {0,0,11}, {0,0,10}, {0,0,9}, {0,0,8}, {0,0,7}, {0,0,6}, {0,0,5}, {0,0,4}, {0,0,3}, {0,0,2}, {0,0,1}, {0,0,0}, // Left edge
{0,0,0}, {0,1,0}, {0,2,0}, {0,3,0}, {0,4,0}, {0,5,0}, // Top edge
{0,5,0}, {0,6,0}, {0,7,0}, {0,8,0}, {0,9,0}, {0,10,0}, {0,11,0}, {0,12,0}, {0,13,0}, {0,14,0}, {0,15,0}, {0,16,0}, {0,17,0}, {0,18,0}, {0,19,0}, // More top edge
{0,19,0}, {0,19,1}, {0,19,2}, {0,19,3}, {0,19,4}, {0,19,5}, {0,19,6}, {0,19,7}, {0,19,8}, {0,19,9}, {0,19,10}, {0,19,11}, {0,19,12}, {0,19,13}, {0,19,14}, {0,19,15}, {0,19,16}, {0,19,17}, {0,19,18}, {0,19,19},// Right edge
{0,19,19}, {0,18,19}, {0,17,19}, {0,16,19}, {0,15,19}, {0,14,19}, {0,13,19}, {0,12,12}, {0,11,19}, // Bottom edge, right half
and this is highlighted after running the processing
offs = pixelOffset;
rb = g = 0;
for(o=0; o<256; o++) {
c = pxls[offs[o]]; <------ this line is highlighted
static final int displays[][] = new int[][] {
{0,20,19} // Screen 0, 20 LEDs across, 19 LEDs down
static final int leds[][] = new int[][] {
{0,9,19}, {0,8,19}, {0,7,19}, {0,6,19}, {0,5,19}, {0,4,19}, {0,3,19}, {0,2,19}, {0,1,19}, {0,0,19},// Bottom edge, left half
{0,0,19}, {0,0,18}, {0,0,17}, {0,0,16}, {0,0,15}, {0,0,14}, {0,0,13}, {0,0,12}, {0,0,11}, {0,0,10}, {0,0,9}, {0,0,8}, {0,0,7}, {0,0,6}, {0,0,5}, {0,0,4}, {0,0,3}, {0,0,2}, {0,0,1}, {0,0,0}, // Left edge
{0,0,0}, {0,1,0}, {0,2,0}, {0,3,0}, {0,4,0}, {0,5,0}, // Top edge
{0,5,0}, {0,6,0}, {0,7,0}, {0,8,0}, {0,9,0}, {0,10,0}, {0,11,0}, {0,12,0}, {0,13,0}, {0,14,0}, {0,15,0}, {0,16,0}, {0,17,0}, {0,18,0}, {0,19,0}, // More top edge
{0,19,0}, {0,19,1}, {0,19,2}, {0,19,3}, {0,19,4}, {0,19,5}, {0,19,6}, {0,19,7}, {0,19,8}, {0,19,9}, {0,19,10}, {0,19,11}, {0,19,12}, {0,19,13}, {0,19,14}, {0,19,15}, {0,19,16}, {0,19,17}, {0,19,18}, {0,19,19},// Right edge
{0,19,19}, {0,18,19}, {0,17,19}, {0,16,19}, {0,15,19}, {0,14,19}, {0,13,19}, {0,12,12}, {0,11,19}, // Bottom edge, right half
and this is highlighted after running the processing
offs = pixelOffset;
rb = g = 0;
for(o=0; o<256; o++) {
c = pxls[offs[o]]; <------ this line is highlighted
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Adalight Reloaded: Super Elite Chuck Norris Edition!
Okay, just a coordinate problem, we can fix this. Note this section:
Keep in mind that arrays are indexed from 0 to N-1...so for a 20x19 grid the bottom-right-most coordinate is (19,18) (because the top-left is (0,0)).
Oh! But, doing the math, this doesn't work out to 75 pixels, reason being that each corner should only be counted once (e.g. 20x19 grid would have 20 pixels along top, 20 along bottom (-1 for gap, so 19 pixels really), and *17* additional pixels left and right (because the corners aren't recounted for the sides). 20+19+17+17=73. Two pixels short. Let's make some adjustments so the math is more favorable...
Let's use a 25x15 grid. It's closer to the 16:9 aspect ratio. We'll keep the single pixel gap at the bottom center (so 24 pixels on lower edge, 25 on top), and because of the corners that's 13 pixels to count left & right. 25+24+13+13=75. Here's the revised displays[] declaration:
And the corresponding 75 pixels leds[] declaration would be:
You can test this without physically rearranging any of your LEDs yet; it may look screwy on the wall, but the onscreen preview should appear correct. If that all checks out, you can then move the LEDs to match, or if you need to keep the layout you have maybe there's enough info there on how to fill out that table.
Code: Select all
static final int displays[][] = new int[][] {
{0,20,19} }; // Screen 0, 20 LEDs across, 19 LEDs down
Oh! But, doing the math, this doesn't work out to 75 pixels, reason being that each corner should only be counted once (e.g. 20x19 grid would have 20 pixels along top, 20 along bottom (-1 for gap, so 19 pixels really), and *17* additional pixels left and right (because the corners aren't recounted for the sides). 20+19+17+17=73. Two pixels short. Let's make some adjustments so the math is more favorable...
Let's use a 25x15 grid. It's closer to the 16:9 aspect ratio. We'll keep the single pixel gap at the bottom center (so 24 pixels on lower edge, 25 on top), and because of the corners that's 13 pixels to count left & right. 25+24+13+13=75. Here's the revised displays[] declaration:
Code: Select all
static final int displays[][] = new int[][] {
{0,25,15} }; // Screen 0, 25 LEDs across, 15 LEDs down
Code: Select all
static final int leds[][] = new int[][] {
{0,11,14}, {0,10,14}, {0, 9,14}, {0, 8,14}, {0, 7,14}, {0, 6,14}, {0, 5,14}, {0, 4,14}, {0, 3,14}, {0, 2,14}, {0, 1,14}, {0, 0,14}, // Bottom edge, left half (working left)
{0, 0,13}, {0, 0,12}, {0, 0,11}, {0, 0,10}, {0, 0, 9}, {0, 0, 8}, {0, 0, 7}, {0, 0, 6}, {0, 0, 5}, {0, 0, 4}, {0, 0, 3}, {0, 0, 2}, {0, 0, 1}, // Left edge (working up)
{0, 0, 0}, {0, 1, 0}, {0, 2, 0}, {0, 3, 0}, {0, 4, 0}, {0, 5, 0}, {0, 6, 0}, {0, 7, 0}, {0, 8, 0}, {0, 9, 0}, {0,10, 0}, {0,11, 0}, // Top edge, left half (working right)
{0,12, 0}, {0,13, 0}, {0,14, 0}, {0,15, 0}, {0,16, 0}, {0,17, 0}, {0,18, 0}, {0,19, 0}, {0,20, 0}, {0,21, 0}, {0,22, 0}, {0,23, 0}, {0,24, 0}, // Top edge, right half
{0,24, 1}, {0,24, 2}, {0,24, 3}, {0,24, 4}, {0,24, 5}, {0,24, 6}, {0,24, 7}, {0,24, 8}, {0,24, 9}, {0,24,10}, {0,24,11}, {0,24,12}, {0,24,13}, // Right edge (working down)
{0,24,14}, {0,23,14}, {0,22,14}, {0,21,14}, {0,20,14}, {0,19,14}, {0,18,14}, {0,17,14}, {0,16,14}, {0,15,14}, {0,14,14}, {0,13,14} }; // Bottom edge, right half (working left)
-
- Posts: 3
- Joined: Wed Jul 16, 2014 5:33 pm
Re: Adalight Reloaded: Super Elite Chuck Norris Edition!
It's working great. Thank you so much. Another question, if I were to use the LED strips do I really need a bread board and transistors?
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Adalight Reloaded: Super Elite Chuck Norris Edition!
Transistors are only needed for our 'analog' LED strips. WS2801 LEDs can be controlled directly from the Arduino pins.
Please be positive and constructive with your questions and comments.