marcmerlin / fastled_neomatrix Goto Github PK
View Code? Open in Web Editor NEWAdafruit GFX compatible library for NeoPixel based Matrices using FastLED library
License: GNU General Public License v3.0
Adafruit GFX compatible library for NeoPixel based Matrices using FastLED library
License: GNU General Public License v3.0
Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:
Do not use GitHub issues for troubleshooting projects and issues. Instead use
the forums at http://forums.adafruit.com to ask questions and troubleshoot why
something isn't working as expected. In many cases the problem is a common issue
that you will more quickly receive help from the forum community. GitHub issues
are meant for known defects in the code. If you don't know if there is a defect
in the code then start with troubleshooting on the forum first.
If following a tutorial or guide be sure you didn't miss a step. Carefully
check all of the steps and commands to run have been followed. Consult the
forum if you're unsure or have questions about steps in a guide/tutorial.
For Arduino projects check these very common issues to ensure they don't apply:
For uploading sketches or communicating with the board make sure you're using
a USB data cable and not a USB charge-only cable. It is sometimes
very hard to tell the difference between a data and charge cable! Try using the
cable with other devices or swapping to another cable to confirm it is not
the problem.
Be sure you are supplying adequate power to the board. Check the specs of
your board and plug in an external power supply. In many cases just
plugging a board into your computer is not enough to power it and other
peripherals.
Double check all soldering joints and connections. Flakey connections
cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.
Ensure you are using an official Arduino or Adafruit board. We can't
guarantee a clone board will have the same functionality and work as expected
with this code and don't support them.
If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:
Arduino board: INSERT ARDUINO BOARD NAME/TYPE HERE
Arduino IDE version (found in Arduino -> About Arduino menu): INSERT ARDUINO
VERSION HERE
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): LIST REPRO STEPS BELOW
I'm using a remap return function for my non-rectangular shaped matrix such as this:
uint16_t pixelArray[12][12] = {0,1,2,3,4,5,6,7,8,9,10,11,
23,22,21,20,19,18,17,16,15,14,13,12,
24,25,26,27,28,29,30,31,32,33,34,35,
47,46,45,44,43,42,41,-1,-1,-1,-1,-1,
48,49,50,51,52,53,54,-1,-1,-1,-1,-1,
71,70,69,68,67,66,65,-1,-1,-1,-1,-1,
72,73,74,75,76,77,78,-1,-1,-1,-1,-1,
95,94,93,92,91,90,89,-1,-1,-1,-1,-1,
96,97,98,99,100,101,102,-1,-1,-1,-1,-1,
119,118,117,116,115,114,113,112,111,110,109,108,
120,121,122,123,124,125,126,127,128,129,130,131,
143,142,141,140,139,138,137,136,135,134,133,132};
uint16_t myRemapFn(uint16_t x, uint16_t y) {
return pixelArray[x][y];
}
Works with Neopixel code because when drawPixel calls setPixelColor, setPixelColor checks if n < numLeds. Framebuffer_GFX just checks to see if x and y are in bounds, but doesn't allow for an odd shape such as mine, so drawPixel simply sets _fb[XY(x,y)] = color. Adding a check to ensure result of XY(x,y) < numpix fixes it.
right now i found (Horizontal S)
1 - 2-3-4-5
10-9-8-7-6
11..............15
&
1 - 2-3-4-5
6-7-8-9-10
11..............15
i want (Vertical Z connection)
1 6 11
2 7 12
3 8 13
4 9 14
5 10 15
i wrote fixed array for that,
{
1,6 ,11 ,16 ,21 ,26 ,31 ,36,
2,7 ,12 ,17 ,22 ,27 ,32 ,37,
3,8 ,13 ,18 ,23 ,28 ,33 ,38,
4,9 ,14 ,19 ,24 ,29 ,34 ,39,
5,10 ,15 ,20 ,25 ,30 ,35 ,40
};
but i want to know that any library have this function?
thanks
Not sure if this is the right place so...
Using Marc's library I'm able to get scrolling text to work across my (self constructed) matrix but only to a point...
Once I enter a width of more than 34 pixels one (or more) library's fail.
My matrix is 37*8 (basic text scroller) and I get back (serial output) either Framebuffer_GFX:begin Width 37 Height 7688 Num Pixels 1094851080
or
Framebuffer_Framebuffer_
then hangs...
I've tried to identify the issue within Adafruit_GFX.h and Fastled_Neomatrix.h but cannot find why this error occurs.
Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:
Do not use GitHub issues for troubleshooting projects and issues. Instead use
the forums at http://forums.adafruit.com to ask questions and troubleshoot why
something isn't working as expected. In many cases the problem is a common issue
that you will more quickly receive help from the forum community. GitHub issues
are meant for known defects in the code. If you don't know if there is a defect
in the code then start with troubleshooting on the forum first.
If following a tutorial or guide be sure you didn't miss a step. Carefully
check all of the steps and commands to run have been followed. Consult the
forum if you're unsure or have questions about steps in a guide/tutorial.
For Arduino projects check these very common issues to ensure they don't apply:
For uploading sketches or communicating with the board make sure you're using
a USB data cable and not a USB charge-only cable. It is sometimes
very hard to tell the difference between a data and charge cable! Try using the
cable with other devices or swapping to another cable to confirm it is not
the problem.
Be sure you are supplying adequate power to the board. Check the specs of
your board and plug in an external power supply. In many cases just
plugging a board into your computer is not enough to power it and other
peripherals.
Double check all soldering joints and connections. Flakey connections
cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.
Ensure you are using an official Arduino or Adafruit board. We can't
guarantee a clone board will have the same functionality and work as expected
with this code and don't support them.
If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:
Arduino board: INSERT ARDUINO BOARD NAME/TYPE HERE
Arduino IDE version (found in Arduino -> About Arduino menu): INSERT ARDUINO
VERSION HERE
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): LIST REPRO STEPS BELOW
Is possible to change the date pin as is not listed in the config.h , the default is pin 6 for the data pin,
is the a line I need to edit?
Thanks x the help
When running a sketch that uses FastLED output such as APA102, there is a period where most of the LEDs are set to a random color, almost as if the CRGB array is set as uninitialized. So if I run my own startup panel that lights each LED up and then turns off, the randomness is replaced.
I simpler workaround is to use fill_solid with black, during setup, but that doesn't remove the flash of random, only leaves the matrix in a clean state ready for loop
Hi,
The problem I'm having is that any gifs I'm uploading to the ESP8266 controller, the all playing at the same speed, even if the animation is slow still play fast, is any way to set the speed for the gifs.
Any help will be appreciate
Thanks
Hi there,
I have an 8x8 matrix which I'm using to display animated shapes using FastLED_NeoMatrix. Obviously 8x8 is very low resolution. I'm wondering if there's a(n easy) way to draw at a higher resolution and have the resulting image rendered with anti-aliasing at the resolution of the matrix?
For example, I want to draw a point at the centre of the matrix. At the moment, if I draw a point at (MATRIX_WIDTH/2,MATRIX_HEIGHT/2), I get a single off-centre LED lit brightly. What I'd rather have is all four LEDs around the centre point lit slightly less brightly.
Is this a problem which already has a solution? I've looked at this library, Framebuffer_GFX and Adafruit-GFX-Library but haven't found anything helpful. I've searched the web and found nothing useful either.
Any help would be appreciated.
Thanks,
rah
Hi Marc...great work on all this stuff! Unfortunately, the actual files for above sub-folder in the Examples are not included in the ZIP file - can you update? Thanks, Frank
I have basically the exact same setup as you do for the NeoMatrix_LedMatrix (3 - 32x8 Matrix's) and it works great for that demo. I like to get all of the NeoMatrix_LedMatrix_IR effects setup but it constantly tells me to create a config but I can find any notes on where to define the config.
There is a neomatrix_config.h and nfldefines.h. As a software dev myself I feel i've spent way more time on this then I should have too to understand it.
I appreciate all your efforts and posts but you don't explain how to utilize this massive new library.
If you could kindly offer some assistance I would appreciate it.
I attempted to define a matrix across a neopixel 4 digit 7-segment display I made and then made a demo to basically scroll a horizontal then vertical line across the matrix as a test. It sort of works in that I see pixels lighting up left to right then top to bottom but they aren't in a perfect line. Am I doing anything obvious wrong? I triple checked my remap function and didn't see any errors.
Here is a video showing my PCB and what I'm seeing: https://imgur.com/a/d6oy3uL
The code that produces that is below, any thought on what might be happening?
#include <Adafruit_GFX.h>
#include <FastLED_NeoMatrix.h>
#include <FastLED.h>
#define PIN 18
#define BRIGHTNESS 10
#define mw 25
#define mh 9
#define NUMMATRIX (mw*mh)
CRGB leds[NUMMATRIX];
// Define matrix width and height.
FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, mw, mh,
NEO_MATRIX_TOP + NEO_MATRIX_LEFT +
NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE);
// This could also be defined as matrix->color(255,0,0) but those defines
// are meant to work for adafruit_gfx backends that are lacking color()
#define LED_BLACK 0
#define LED_RED_VERYLOW (3 << 11)
#define LED_RED_LOW (7 << 11)
#define LED_RED_MEDIUM (15 << 11)
#define LED_RED_HIGH (31 << 11)
#define LED_GREEN_VERYLOW (1 << 5)
#define LED_GREEN_LOW (15 << 5)
#define LED_GREEN_MEDIUM (31 << 5)
#define LED_GREEN_HIGH (63 << 5)
// .0 .1 .2 .3 .4 .5 .6 .7 .8 .9 10 11.12 13 14 15 16 17 18 19 20 21 22 23 24
// 0 .. .1 .2 .3 .. .. .. 22 23 24 .. .. .. .. .. 43 44 45 .. .. .. 64 65 66 ..
// 1 18 .. .. .. .4 .. 39 .. .. .. 25 .. .. .. 60 .. .. .. 46 .. 81 .. .. .. 67
// 2 17 .. .. .. .5 .. 38 .. .. .. 26 .. 85 .. 59 .. .. .. 47 .. 80 .. .. .. 68
// 3 16 .. .. .. .6 .. 37 .. .. .. 27 .. .. .. 58 .. .. .. 48 .. 79 .. .. .. 69
// 4 .. 19 20 21 .. .. .. 40 41 42 .. .. .. .. .. 61 62 63 .. .. .. 82 83 84 ..
// 5 15 .. .. .. .7 .. 36 .. .. .. 28 .. .. .. 57 .. .. .. 49 .. 78 .. .. .. 70
// 6 14 .. .. .. .8 .. 35 .. .. .. 29 .. 86 .. 56 .. .. .. 50 .. 77 .. .. .. 71
// 7 13 .. .. .. .9 .. 34 .. .. .. 30 .. .. .. 55 .. .. .. 51 .. 76 .. .. .. 72
// 8 .. 12 11 10 .. .. .. 33 32 31 .. .. .. .. .. 54 53 52 .. .. .. 75 74 73 ..
uint16_t myRemapFn(uint16_t x, uint16_t y) {
switch(y){
case 0:
switch(x){
case 1: return 1;
case 2: return 2;
case 3: return 3;
case 7: return 22;
case 8: return 23;
case 9: return 24;
case 15: return 43;
case 16: return 44;
case 17: return 45;
case 21: return 64;
case 22: return 65;
case 23: return 66;
default: return 87;
}
case 1:
switch(x){
case 0: return 18;
case 4: return 4;
case 6: return 39;
case 10: return 25;
case 14: return 60;
case 18: return 46;
case 20: return 81;
case 24: return 67;
default: return 87;
}
case 2:
switch(x){
case 0: return 17;
case 4: return 5;
case 6: return 38;
case 10: return 26;
case 12: return 85;
case 14: return 59;
case 18: return 47;
case 20: return 80;
case 24: return 68;
default: return 87;
}
case 3:
switch(x){
case 0: return 16;
case 4: return 6;
case 6: return 37;
case 10: return 27;
case 14: return 58;
case 18: return 48;
case 20: return 79;
case 24: return 69;
default: return 87;
}
case 4:
switch(x){
case 1: return 19;
case 2: return 20;
case 3: return 21;
case 7: return 40;
case 8: return 41;
case 9: return 42;
case 15: return 61;
case 16: return 62;
case 17: return 63;
case 21: return 82;
case 22: return 83;
case 23: return 84;
default: return 87;
}
case 5:
switch(x){
case 0: return 15;
case 4: return 7;
case 6: return 36;
case 10: return 28;
case 14: return 57;
case 18: return 49;
case 20: return 78;
case 24: return 70;
default: return 87;
}
case 6:
switch(x){
case 0: return 14;
case 4: return 8;
case 6: return 35;
case 10: return 29;
case 12: return 86;
case 14: return 56;
case 18: return 50;
case 20: return 77;
case 24: return 71;
default: return 87;
}
case 7:
switch(x){
case 0: return 13;
case 4: return 9;
case 6: return 34;
case 10: return 30;
case 14: return 55;
case 18: return 51;
case 20: return 76;
case 24: return 72;
default: return 87;
}
case 8:
switch(x){
case 1: return 12;
case 2: return 11;
case 3: return 10;
case 7: return 33;
case 8: return 32;
case 9: return 31;
case 15: return 54;
case 16: return 53;
case 17: return 52;
case 21: return 75;
case 22: return 74;
case 23: return 73;
default: return 87;
}
}
}
void scrolling_line(){
for (uint8_t i = 0;i<mw;i++){
matrix->clear();
matrix->drawLine(i,0,i,mh,LED_RED_HIGH);
matrix->show();
delay(500);
}
for (uint8_t i = 0;i<mh;i++){
matrix->clear();
matrix->drawLine(0,i,mw,i,LED_GREEN_HIGH);
matrix->show();
delay(500);
}
}
void setup() {
// put your setup code here, to run once:
// Time for serial port to work?
delay(1000);
Serial.begin(115200);
Serial.print("Init on pin: ");
Serial.println(PIN);
Serial.print("Matrix Size: ");
Serial.print(mw);
Serial.print(" ");
Serial.print(mh);
Serial.print(" ");
Serial.println(NUMMATRIX);
FastLED.addLeds<NEOPIXEL,PIN>( leds, NUMMATRIX ).setCorrection(TypicalLEDStrip);
Serial.print("Setup serial: ");
Serial.println(NUMMATRIX);
matrix->begin();
matrix->setTextWrap(false);
matrix->setBrightness(BRIGHTNESS);
matrix->setRemapFunction(myRemapFn);
}
void loop() {
// put your main code here, to run repeatedly:
scrolling_line();
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.