Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



NEO Pixel LED MATRI...
 
Share:
Notifications
Clear all

[Solved] NEO Pixel LED MATRIX

1 Posts
1 Users
0 Reactions
1,953 Views
(@richardwg)
Active Member
Joined: 8 years ago
Posts: 2
Topic starter  

Hi Hans, hope you doing well.

I'd like to request your help with a bit of code. I'm programming a LED matrix and still doing the setup routine, but for some reason my rows and columns seems to come out messed up. I'm using an teensy3.2 which has enough RAM to drive all my LEDS but I just cant seem to get rows and columns correct. Below is a copy of the code currently. The matrix is column major and starts in the top right with 48LEDS per column and 24 rows in a ZIGZAG pattern. 

The code below is suppose to light the first three leds in Row 0 i.e (O,0; 0,1; 0,2) instead I get (0,0; 1,0; 2,0)

#include <Adafruit_NeoPixel.h>

#include <Adafruit_GFX.h>

#include <Adafruit_NeoMatrix.h>

#include <gamma.h>

#include "RGB.h"

#define PIN 5

Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(48, 24, PIN,

  NEO_MATRIX_TOP + NEO_MATRIX_RIGHT +

  NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,

  NEO_GRB + NEO_KHZ800);

void setup() {

  matrix.begin();

  matrix.setBrightness(30);

  matrix.setTextColor( matrix.Color(255, 255, 255) );

  matrix.setTextWrap(false);

}

// RGB values from 0-255

//Color(uint8_t r, uint8_t g, uint8_t b);

void loop() {

matrix.drawPixel(0, 0, matrix.Color(red.r, red.g, red.b));

matrix.drawPixel(0, 1, matrix.Color(red.r, red.g, red.b)); 

matrix.drawPixel(0, 2, matrix.Color(red.r, red.g, red.b));  

matrix.show();

}


   
ReplyQuote
Share: