Hello
I'm new with Arduino.
I have found a Code what i wnat to try with my WS2812B 16x16 Matrix.
If i compile the code i receive all the time the follow errors:
Arduino: 1.8.4 (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users\lausi\Documents\Arduino\sketch_ESS\sketch_ESS.ino: In function 'void bitmap32POV(int)':
sketch_ESS:113: error: expected primary-expression before ';' token
for (uint16_t column = 0; column < BMPHEIGHT; column++)
^
sketch_ESS:113: error: expected ')' before ';' token
sketch_ESS:113: error: 'column' was not declared in this scope
for (uint16_t column = 0; column < BMPHEIGHT; column++)
^
exit status 1
expected primary-expression before ';' token
The Code is the follow:
/* Digital Fotografie Hacks
* Neopixel POV:
* Ein POV Display mit Adafruit Neopixel Sticks
* v0.1, 2014-12-14, Peter Recktenwald
*/
/*-----( Importiere benoetigte Bibliotheken )-----*/
#include <Adafruit_NeoPixel.h>
#include <avr/pgmspace.h>
#include "C:\Users\lausi\Documents\Arduino\libraries\Adafruit_NeoMatrix\gamma.h"
// #include "./image888.c"
/*-----( Definitionen )-----*/
#define pixelPin 6
#define COLUMN_TIME 15 // Time[ms] of every single column is switched on
#define SPACER 10 // This value multiplied the columnTime to get a spacer between the content of the whole array
/*-----( Variablen )-----*/
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
#define COLOR_BPP 16
#define COLOR_STORAGE_SIZE 2
#define BMPWIDTH 16;
#define BMPHEIGHT 16;
const unsigned long image32[] = {
0x00ad458d, 0x00ad448d, 0x00ad448d, 0x00ad448d, 0x00ad448d, 0x00ad448d,
0x00ad448d, 0x00ad448d, 0x00ad448d, 0x00ad448d, 0x00ad448d, 0x00ad448d,
0x00ad448d, 0x00ad448d, 0x00ad438c, 0x00ad448d, 0x00ad448c, 0x00ad438d,
0x00ac438c, 0x00ad448d, 0x00ad458e, 0x00ad448d, 0x00ad458d, 0x00ad448d,
0x00ac428b, 0x00ad468e, 0x00ad448d, 0x00ad458d, 0x00ad458e, 0x00ad448d,
0x00ac428b, 0x00ad438d, 0x00ad458d, 0x00ac438c, 0x00ad458d, 0x00ab408a,
0x00a93b87, 0x00ad458d, 0x00aa3e89, 0x00ab408a, 0x00af4a91, 0x00a83987,
0x00ad448d, 0x00ab3f8a, 0x00a93b87, 0x00ad448d, 0x00ad438c, 0x00ac438c,
0x00ac448c, 0x00ad458d, 0x00a93d88, 0x00b35295, 0x00be6ba5, 0x00a93c88,
0x00b45597, 0x00ead2e2, 0x00f6ebf2, 0x00d4a0c3, 0x00a63584, 0x00b45697,
0x00bd6aa4, 0x00aa3f8a, 0x00ac428b, 0x00ad448d, 0x00ae478e, 0x00aa3f8a,
0x00b45697, 0x00f3e6ee, 0x00ffffff, 0x00d7a6c7, 0x00ddb3ce, 0x00ffffff,
0x00fefffb, 0x00fffffd, 0x00c780b1, 0x00f4e8ed, 0x00ffffff, 0x00d8a8c8,
0x00a83a87, 0x00ad458d, 0x00af4a90, 0x00a63784, 0x00c67fb0, 0x00ffffff,
0x00ffffff, 0x00f6edf1, 0x00e1bcd4, 0x00ffffff, 0x00ffffff, 0x00fcfaf8,
0x00dbaecc, 0x00ffffff, 0x00ffffff, 0x00f7eff2, 0x00ab418b, 0x00ac438c,
0x00ad468d, 0x00ab418b, 0x00b04c92, 0x00e4c2d8, 0x00f2e3ed, 0x00cc8bb7,
0x00b04c92, 0x00e4c2d9, 0x00eed8e7, 0x00cd8eb9, 0x00af4990, 0x00e7c9dc,
0x00f2e2ed, 0x00ca87b4, 0x00a93c88, 0x00ad458d, 0x00ad458d, 0x00ac448c,
0x00a73886, 0x00c276ab, 0x00d49dc3, 0x00b85f9d, 0x00a83986, 0x00c47aae,
0x00d095be, 0x00b85e9d, 0x00a83a87, 0x00c680b1, 0x00d39cc2, 0x00b35497,
0x00a93b87, 0x00ad458e, 0x00ae488f, 0x00a83986, 0x00d8a9ca, 0x00ffffff,
0x00ffffff, 0x00e2bfd8, 0x00e3c4db, 0x00ffffff, 0x00ffffff, 0x00fefefe,
0x00d5a3c6, 0x00f6f1f6, 0x00ffffff, 0x00f9f6f9, 0x00bb65a1, 0x00a93c88,
0x00a73684, 0x00ba639f, 0x00fcfefe, 0x00fbfafc, 0x00f2e6f0, 0x00ddb5d1,
0x00ffffff, 0x00fafafb, 0x00f9f9fb, 0x00fdffff, 0x00f5edf4, 0x00dcb2d0,
0x00fbfafb, 0x00fefefe, 0x00e5c8dd, 0x00a83986, 0x00a0267a, 0x00d6a5c8,
0x00ffffff, 0x00ffffff, 0x00e6cbdf, 0x00ebd7e6, 0x00fdfcfd, 0x00fafafb,
0x00fbfcfd, 0x00fafafb, 0x00fdfefe, 0x00dfbad4, 0x00fbfefd, 0x00ffffff,
0x00fcfffe, 0x00b35396, 0x00a73885, 0x00c276ab, 0x00d29ac1, 0x00cf94bd,
0x00cb8ab7, 0x00fbfbfc, 0x00ffffff, 0x00fdffff, 0x00feffff, 0x00fdffff,
0x00ffffff, 0x00e4c7dc, 0x00c884b4, 0x00d29ac1, 0x00d097bf, 0x00b25194,
0x00ad478e, 0x00a93b87, 0x00a63684, 0x00a53382, 0x00ad458d, 0x00bf6fa7,
0x00be6da6, 0x00bf6ea6, 0x00bf6ea6, 0x00be6da6, 0x00bf6ea7, 0x00b9619f,
0x00a63483, 0x00a63684, 0x00a73583, 0x00ac418b, 0x00ac448c, 0x00ad458e,
0x00ae478e, 0x00ae478f, 0x00ac438c, 0x00a83a87, 0x00a93a87, 0x00a93a87,
0x00a93a87, 0x00a93a87, 0x00a83a87, 0x00aa3d89, 0x00ae478f, 0x00ae478e,
0x00ae468d, 0x00ad448d, 0x00ad458d, 0x00ad448d, 0x00ad448d, 0x00ac438c,
0x00ad448d, 0x00ad468e, 0x00ad468e, 0x00ad468e, 0x00ad468e, 0x00ad468e,
0x00ad468e, 0x00ad458d, 0x00ac438c, 0x00ad448d, 0x00ad438c, 0x00ad448d,
0x00ad468d, 0x00ad458d, 0x00ad458d, 0x00ad458d, 0x00ad458d, 0x00ad458d,
0x00ad458d, 0x00ad458d, 0x00ad458d, 0x00ad458d, 0x00ad458d, 0x00ad458d,
0x00ad458d, 0x00ad458d, 0x00ad448c, 0x00ad458d
};
Adafruit_NeoPixel strip = Adafruit_NeoPixel(256, pixelPin, NEO_GRB + NEO_KHZ800);
// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
bitmap32POV(10);
}
// Fill the dots one after the other with a color
void colorWipe(uint32_t c) {
for (uint16_t i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
}
}
// bitmap32POV
void bitmap32POV(int repeat)
{
int raw_r, raw_g, raw_b;
int corr_r, corr_g, corr_b;
int bmpcnt;
for (int i = 0; i < repeat; i++)
{
bmpcnt = 0;
for (uint16_t column = 0; column < BMPHEIGHT; column++)
{
for (uint16_t i = 0; i < strip.numPixels(); i++)
{
raw_b = (image32[bmpcnt] & 0x00ff0000) >> 16;
corr_b = pgm_read_byte(&gamma[raw_b]);
raw_g = (image32[bmpcnt] & 0x0000ff00) >> 8;
corr_g = pgm_read_byte(&gamma[raw_g]);
raw_r = (image32[bmpcnt] & 0x000000ff);
corr_r = pgm_read_byte(&gamma[raw_r]);
bmpcnt++;
strip.setPixelColor(i, strip.Color(corr_r, corr_g, corr_b));
}
strip.show();
delay(COLUMN_TIME );
}
}
colorWipe(0);
delay(10* SPACER * COLUMN_TIME);
}
Can some of you please help me?
Thank you,
Nico