These are chat archives for Makuna/NeoPixelBus

18th
Aug 2018
imKp
@imKp
Aug 18 2018 05:40
I need to render a image to a 20 x 30 Led Wall, this the code I have written

// NeoPixelBuffer
// This example will animate pixels using a bitmap stored on a SD card
//
//
// This will demonstrate the use of the NeoBitmapFile object
// NOTE: The images provided in the example directory should be copied to
// the root of the SD card so the below code will find it.
// NOTE: This sample and the included images were built for a 144 pixel strip so
// running this with a smaller string may not look as interesting. Try providing
// your own 24 bit bitmap for better results.

include <NeoPixelBus.h>

include <SPI.h>

include <SD.h>

const int chipSelect = D8; // make sure to set this to your SD carder reader CS

typedef NeoRgbFeature MyPixelColorFeature;
//typedef NeoGrbwFeature MyPixelColorFeature;

const uint16_t PixelCount = 600; // the sample images are meant for 144 pixels
//const uint16_t PixelPin = 2;
const uint16_t AnimCount = 1; // we only need one

//NeoPixelBus<MyPixelColorFeature, Neo800KbpsMethod> strip(PixelCount, PixelPin);
// for esp8266 omit the pin
NeoPixelBus<MyPixelColorFeature, Neo800KbpsMethod> strip(PixelCount);

NeoTopology<RowMajorAlternating90Layout> topo(20,30); // Enter order of matrix panel

uint16_t MyLayoutMap(int16_t x, int16_t y)
{
return topo.MapProbe(x, y);
}

// our NeoBitmapFile will use the same color feature as NeoPixelBus and
// we want it to use the SD File object
NeoBitmapFile<MyPixelColorFeature, File> image;

void setup() {
Serial.begin(115200);
while (!Serial); // wait for serial attach

strip.Begin();
strip.Show();

Serial.print("Initializing SD card...");

// see if the card is present and can be initialized:
if (!SD.begin(chipSelect))
{
    Serial.println("Card failed, or not present");
    // don't do anything more:
    return;
}
Serial.println("card initialized.");

// open the file
File bitmapFile = SD.open("river.bmp"); 
if (!bitmapFile)
{
    Serial.println("File open fail, or not present");
    // don't do anything more:
    return;
}

// initialize the image with the file
if (!image.Begin(bitmapFile))
{
    Serial.println("File format fail, not a supported bitmap");
    // don't do anything more:
    return;
}

Serial.println(image.PixelCount());

Serial.println("Pixel");

image.Blt(strip, 0, 0, 0, 0, 20, 30, MyLayoutMap(0, 0));

}

void loop() {
// this is all that is needed to keep it running
// and avoiding using delay() is always a good thing for
// any timing related routines

}

imKp
@imKp
Aug 18 2018 05:50
The compiler is showing me error: 'NeoBitmapFile<NeoRgbFeature, File>::Blt(NeoPixelBus<NewoRgbFeature, NeoEsp8266DmaMethodBase<NeoEsp8266DmaSpeed800Kbps>> &, int,int, int int,int, int, uint16_t)'
Michael Miller
@Makuna
Aug 18 2018 06:30
There has to be more to the error than what you copied here. It might be on more than one line.
p.s. To include code, have a line above the code that is just forward single quote and a line following it with just a forward single quote and it will format all the lines between as code. (looks like the ... is no longer supported)

Your problem is more than likely your call to blt, the last param is the function that does the work, not what calling the function returns.

image.Blt(strip, 0, 0, 0, 0, 20, 30, MyLayoutMap); // << pass the function, don't call it

imKp
@imKp
Aug 18 2018 09:02
I passed the function, without calling it then it compiled. In the next line i have written strip.Show(), i see nothing on my mattix, still.
Matrix*
Michael Miller
@Makuna
Aug 18 2018 16:18
First, please include what Arduino hardware you are using. What versions of board support and what version of the NeoPixelBus library.
Second, did you try a simple sketch to test that it is in fact connected correctly? Start with NeoPixelTest.ino example. Then try NeoPixelTopologyTest.ino example.
imKp
@imKp
Aug 18 2018 17:45
Dear Sir, maybe my words could have let you think otherwise, I want to make it clear there is no problem with your library, I'm a novice. It's like your library is aircraft and i have drove only a bicycle, ofcourse there would be much difficulty to drive aircraft on road(land and takeoff) than in air, I hope you do understand. I'm using nodemcu (esp8266). I have tested most of your examples all of them are working smoothly. I have tested the layout example worked fine on my matrix...i could easily see the top left white, bottom left blue, op left red, and bottom left green though I had to change the feature to Rgb from grb in example. I have also tested your bitmap string example on my matrix...it worked. I have tested with the strings and strings with white background bmp image example no problem with it...but I entered the length of string as 144, though my matrix wall is 20*60.
20* 30...I'm working to create a bigger wall...almost 10 feet times 8 feet.