Hi guys,
I am doing a light painting led strip application. Uses a SD card to store a BMP image, and print the image strip by strip over an array of LEDs.
my project uses a Bluno Nano(same mcu as Uno, but with integrated BLE).
my adafruit neopixel library wont work properly after dynamic memory goes above 70%. 69% will still work.. probably due to lack of RAM
was introduced to Teensy 3.1/3.2. hoping to verify its workability first before purchasing.
followed the tutorial on how to use teensy, installed the installer, installed the teensy libraries, set my board to 'Teensy 3.1/3.2', the rest like serial,etc are default.
if needed, my code is here: https://github.com/tzijie/LightStick_Arduino/tree/master/NeoPixel_Painter
Tried to verify my code, and receive the following errors. could someone assist me and point me in the right direction? thank you!
p.s. ive deleted/moved my original arduino Adafruit_NeoPixel library to let the ide use teensy's neopixel library.
I am doing a light painting led strip application. Uses a SD card to store a BMP image, and print the image strip by strip over an array of LEDs.
my project uses a Bluno Nano(same mcu as Uno, but with integrated BLE).
my adafruit neopixel library wont work properly after dynamic memory goes above 70%. 69% will still work.. probably due to lack of RAM
was introduced to Teensy 3.1/3.2. hoping to verify its workability first before purchasing.
followed the tutorial on how to use teensy, installed the installer, installed the teensy libraries, set my board to 'Teensy 3.1/3.2', the rest like serial,etc are default.
if needed, my code is here: https://github.com/tzijie/LightStick_Arduino/tree/master/NeoPixel_Painter
Tried to verify my code, and receive the following errors. could someone assist me and point me in the right direction? thank you!
Code:
Arduino: 1.8.3 (Windows 10), TD: 1.38, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz (overclock), Faster, US English"
In file included from C:\Users\tzj\Desktop\LightStick_Arduino\NeoPixel_Painter\NeoPixel_Painter.ino:14:0:
gamma.h:19: error: 'const uint8_t gamma []' redeclared as different kind of symbol
gamma[] = { // Brightness ramp for LEDs
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:36:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:3,
from C:\Users\tzj\AppData\Local\Temp\arduino_build_388109\sketch\NeoPixel_Painter.ino.cpp:1:
c:\program files (x86)\arduino\hardware\tools\arm\arm-none-eabi\include\math.h:350:15: note: previous declaration 'double gamma(double)'
extern double gamma _PARAMS((double));
^
NeoPixel_Painter: In function 'void convertIMG()':
NeoPixel_Painter:170: warning: suggest parentheses around assignment used as truth value
if(found = bmpProcess(infile, NULL, &b)) {
^
NeoPixel_Painter:225: error: 'TCCR1A' was not declared in this scope
TCCR1A = _BV(WGM11) | _BV(WGM10);
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/wiring.h:38:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:45,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:3,
from C:\Users\tzj\AppData\Local\Temp\arduino_build_388109\sketch\NeoPixel_Painter.ino.cpp:1:
NeoPixel_Painter:225: error: 'WGM11' was not declared in this scope
TCCR1A = _BV(WGM11) | _BV(WGM10);
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:47:22: note: in definition of macro '_BV'
#define _BV(n) (1<<(n))
^
NeoPixel_Painter:225: error: 'WGM10' was not declared in this scope
TCCR1A = _BV(WGM11) | _BV(WGM10);
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:47:22: note: in definition of macro '_BV'
#define _BV(n) (1<<(n))
^
NeoPixel_Painter:226: error: 'TCCR1B' was not declared in this scope
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/wiring.h:38:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:45,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:3,
from C:\Users\tzj\AppData\Local\Temp\arduino_build_388109\sketch\NeoPixel_Painter.ino.cpp:1:
NeoPixel_Painter:226: error: 'WGM13' was not declared in this scope
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:47:22: note: in definition of macro '_BV'
#define _BV(n) (1<<(n))
^
NeoPixel_Painter:226: error: 'WGM12' was not declared in this scope
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:47:22: note: in definition of macro '_BV'
#define _BV(n) (1<<(n))
^
NeoPixel_Painter:226: error: 'CS11' was not declared in this scope
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:47:22: note: in definition of macro '_BV'
#define _BV(n) (1<<(n))
^
NeoPixel_Painter:226: error: 'CS10' was not declared in this scope
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:47:22: note: in definition of macro '_BV'
#define _BV(n) (1<<(n))
^
NeoPixel_Painter: In function 'void loop()':
NeoPixel_Painter:322: error: 'TIMSK0' was not declared in this scope
TIMSK0 = 0; //for smoother playback
^
NeoPixel_Painter:354: error: 'OCR1A' was not declared in this scope
OCR1A = (F_CPU / 64) / linesPerSec; // Timer1 interval
^
NeoPixel_Painter:360: error: 'TIFR1' was not declared in this scope
while(!(TIFR1 & _BV(TOV1))); // Wait for Timer1 overflow
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/wiring.h:38:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:45,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:3,
from C:\Users\tzj\AppData\Local\Temp\arduino_build_388109\sketch\NeoPixel_Painter.ino.cpp:1:
NeoPixel_Painter:360: error: 'TOV1' was not declared in this scope
while(!(TIFR1 & _BV(TOV1))); // Wait for Timer1 overflow
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:47:22: note: in definition of macro '_BV'
#define _BV(n) (1<<(n))
^
NeoPixel_Painter:361: error: 'TIFR1' was not declared in this scope
TIFR1 |= _BV(TOV1); // Clear overflow bit
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/wiring.h:38:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:45,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:3,
from C:\Users\tzj\AppData\Local\Temp\arduino_build_388109\sketch\NeoPixel_Painter.ino.cpp:1:
NeoPixel_Painter:361: error: 'TOV1' was not declared in this scope
TIFR1 |= _BV(TOV1); // Clear overflow bit
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:47:22: note: in definition of macro '_BV'
#define _BV(n) (1<<(n))
^
NeoPixel_Painter:381: error: 'TIMSK0' was not declared in this scope
TIMSK0 = 1;
^
NeoPixel_Painter: In function 'boolean bmpProcess(char*, char*, uint8_t*)':
NeoPixel_Painter:450: warning: dereferencing type-punned pointer will break strict-aliasing rules
(*(uint16_t *)&sdBuf[ 0] == 0x4D42) && // BMP signature
^
NeoPixel_Painter:451: warning: dereferencing type-punned pointer will break strict-aliasing rules
(*(uint16_t *)&sdBuf[26] == 1) && // Planes: must be 1
^
NeoPixel_Painter:452: warning: dereferencing type-punned pointer will break strict-aliasing rules
(*(uint16_t *)&sdBuf[28] == 24) && // Bits per pixel: must be 24
^
NeoPixel_Painter:453: warning: dereferencing type-punned pointer will break strict-aliasing rules
(*(uint32_t *)&sdBuf[30] == 0)) { // Compression: must be 0 (none)
^
NeoPixel_Painter:455: warning: dereferencing type-punned pointer will break strict-aliasing rules
bmpImageoffset = *(uint32_t *)&sdBuf[10]; // Start of image data
^
NeoPixel_Painter:456: warning: dereferencing type-punned pointer will break strict-aliasing rules
bmpWidth = *(uint32_t *)&sdBuf[18]; // Image dimensions
^
NeoPixel_Painter:457: warning: dereferencing type-punned pointer will break strict-aliasing rules
bmpHeight = *(uint32_t *)&sdBuf[22];
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:41:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:3,
from C:\Users\tzj\AppData\Local\Temp\arduino_build_388109\sketch\NeoPixel_Painter.ino.cpp:1:
NeoPixel_Painter:539: warning: pointer to a function used in arithmetic
corr = pgm_read_byte(&gamma[raw]); // Gamma-corrected
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/avr/pgmspace.h:95:55: note: in definition of macro 'pgm_read_byte'
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
^
'const uint8_t gamma []' redeclared as different kind of symbol
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
p.s. ive deleted/moved my original arduino Adafruit_NeoPixel library to let the ide use teensy's neopixel library.