I keep getting the error adafruit_lsm303_accel does not name a type when using the code. I have no idea what is wrong.
Please help. I have an event this week and was dying to wear this!!
LED sparkle skirt -HELP!!!
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: LED sparkle skirt -HELP!!!
Post your code and the error log and we will take a look. Please use code tags when posting code or logs to the forums. It preserves formatting and makes it easier for everyone to read the code. Click the code button above the reply box and past your code between the tags created.
- Sragle1
- Posts: 5
- Joined: Sun Dec 10, 2017 7:01 pm
Re: LED sparkle skirt -HELP!!!
Thank you! I just used the code from the tutorial. Here is the detailed log
Code: Select all
Arduino: 1.8.5 (Windows 7), Board: "Adafruit Flora"
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Mourning Blade\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Mourning Blade\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Mourning Blade\Documents\Arduino\libraries -fqbn=adafruit:avr:flora8 -ide-version=10805 -build-path C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481 -warnings=none -build-cache C:\Users\MOURNI~1\AppData\Local\Temp\arduino_cache_971503 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Mourning Blade\Desktop\sketch_dec11a\sketch_dec11a.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Mourning Blade\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Mourning Blade\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Mourning Blade\Documents\Arduino\libraries -fqbn=adafruit:avr:flora8 -ide-version=10805 -build-path C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481 -warnings=none -build-cache C:\Users\MOURNI~1\AppData\Local\Temp\arduino_cache_971503 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Mourning Blade\Desktop\sketch_dec11a\sketch_dec11a.ino
Using board 'flora8' from platform in folder: C:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481\sketch\sketch_dec11a.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481\sketch\sketch_dec11a.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481\sketch\sketch_dec11a.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481\sketch\sketch_dec11a.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481\sketch\sketch_dec11a.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire\utility" "C:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire\TinyWireM.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire\utility" "C:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire\USI_TWI_Master.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire\utility" "C:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire\Wire.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire\utility" "C:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire\utility\twi.c" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC\Adafruit_LSM303_U.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel\esp8266.c" -o "nul"
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481\sketch\sketch_dec11a.ino.cpp" -o "C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10805 -DARDUINO_AVR_FLORA8 -DARDUINO_ARCH_AVR -DUSB_VID=0x239A -DUSB_PID=0x8004 '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Flora"' "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\variants\flora" "-IC:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC" "-IC:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481\sketch\sketch_dec11a.ino.cpp" -o "C:\Users\MOURNI~1\AppData\Local\Temp\arduino_build_666481\sketch\sketch_dec11a.ino.cpp.o"
sketch_dec11a:14: error: 'Adafruit_LSM303_Accel' does not name a type
Adafruit_LSM303_Accel accel = Adafruit_LSM303_Accel(54321);
^
C:\Users\Mourning Blade\Desktop\sketch_dec11a\sketch_dec11a.ino: In function 'void setup()':
sketch_dec11a:35: error: 'accel' was not declared in this scope
if (!accel.begin())
^
C:\Users\Mourning Blade\Desktop\sketch_dec11a\sketch_dec11a.ino: In function 'void loop()':
sketch_dec11a:48: error: 'accel' was not declared in this scope
accel.getEvent(&event);
^
Using library Wire at version 1.0 in folder: C:\Users\Mourning Blade\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9\libraries\Wire
Using library Adafruit_Sensor at version 1.0.2 in folder: C:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_Sensor
Using library Adafruit_LSM303DLHC at version 1.0.3 in folder: C:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_LSM303DLHC
Using library Adafruit_NeoPixel at version 1.1.3 in folder: C:\Users\Mourning Blade\Documents\Arduino\libraries\Adafruit_NeoPixel
exit status 1
'Adafruit_LSM303_Accel' does not name a typeInline image 1
- Sragle1
- Posts: 5
- Joined: Sun Dec 10, 2017 7:01 pm
Re: LED sparkle skirt -HELP!!!
Code: Select all
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LSM303.h>
#include <Adafruit_NeoPixel.h>
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)
// NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(6, 6, NEO_GRB + NEO_KHZ800);
Adafruit_LSM303_Accel accel = Adafruit_LSM303_Accel(54321);
// Here is where you can put in your favorite colors that will appear!
// just add new {nnn, nnn, nnn}, lines. They will be picked out randomly
// R G B
uint8_t myFavoriteColors[][3] = {{200, 0, 200}, // purple
{200, 0, 0}, // red
{200, 200, 200}, // white
};
// don't edit the line below
#define FAVCOLORS sizeof(myFavoriteColors) / 3
// mess with this number to adjust TWINklitude :)
// lower number = more sensitive
#define MOVE_THRESHOLD 45
void setup()
{
Serial.begin(9600);
// Try to initialise and warn if we couldn't detect the chip
if (!accel.begin())
{
Serial.println("Oops ... unable to initialize the LSM303. Check your wiring!");
while (1);
}
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop()
{
/* Get a new sensor event */
sensors_event_t event;
accel.getEvent(&event);
Serial.print("Accel X: "); Serial.print(event.acceleration.x); Serial.print(" ");
Serial.print("Y: "); Serial.print(event.acceleration.y); Serial.print(" ");
Serial.print("Z: "); Serial.print(event.acceleration.z); Serial.print(" ");
// Get the magnitude (length) of the 3 axis vector
// http://en.wikipedia.org/wiki/Euclidean_vector#Length
double storedVector = event.acceleration.x*event.acceleration.x;
storedVector += event.acceleration.y*event.acceleration.y;
storedVector += event.acceleration.z*event.acceleration.z;
storedVector = sqrt(storedVector);
Serial.print("Len: "); Serial.println(storedVector);
// wait a bit
delay(100);
// get new data!
accel.getEvent(&event);
double newVector = event.acceleration.x*event.acceleration.x;
newVector += event.acceleration.y*event.acceleration.y;
newVector += event.acceleration.z*event.acceleration.z;
newVector = sqrt(newVector);
Serial.print("New Len: "); Serial.println(newVector);
// are we moving
if (abs(newVector - storedVector) > MOVE_THRESHOLD) {
Serial.println("Twinkle!");
flashRandom(5, 1); // first number is 'wait' delay, shorter num == shorter twinkle
flashRandom(5, 3); // second number is how many neopixels to simultaneously light up
flashRandom(5, 2);
}
}
void flashRandom(int wait, uint8_t howmany) {
for(uint16_t i=0; i<howmany; i++) {
// pick a random favorite color!
int c = random(FAVCOLORS);
int red = myFavoriteColors[c][0];
int green = myFavoriteColors[c][1];
int blue = myFavoriteColors[c][2];
// get a random pixel from the list
int j = random(strip.numPixels());
//Serial.print("Lighting up "); Serial.println(j);
// now we will 'fade' it in 5 steps
for (int x=0; x < 5; x++) {
int r = red * (x+1); r /= 5;
int g = green * (x+1); g /= 5;
int b = blue * (x+1); b /= 5;
strip.setPixelColor(j, strip.Color(r, g, b));
strip.show();
delay(wait);
}
// & fade out in 5 steps
for (int x=5; x >= 0; x--) {
int r = red * x; r /= 5;
int g = green * x; g /= 5;
int b = blue * x; b /= 5;
strip.setPixelColor(j, strip.Color(r, g, b));
strip.show();
delay(wait);
}
}
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: LED sparkle skirt -HELP!!!
You have different code than the sample in the sparkle skirt tutorial. The original code compiles but yours does not.
- Sragle1
- Posts: 5
- Joined: Sun Dec 10, 2017 7:01 pm
Re: LED sparkle skirt -HELP!!!
The tutorial had two codes, an original and one for the new version of the LSM303. I used the one for the new version.
I actually tried both, but recieved errors on upload with the first code, though it did compile. I assumed that the upload errors were due to it being the wrong version of the lsm303, so switched to the second, which throws the “accel” error.
I actually tried both, but recieved errors on upload with the first code, though it did compile. I assumed that the upload errors were due to it being the wrong version of the lsm303, so switched to the second, which throws the “accel” error.
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: LED sparkle skirt -HELP!!!
OK, I get the same error there. I'll pass this on to the authors.
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: LED sparkle skirt -HELP!!!
Try changing this line:
to this line:
Code: Select all
Adafruit_LSM303_Accel accel = Adafruit_LSM303_Accel(54321);
Code: Select all
Adafruit_LSM303_Accel_Unified accel = Adafruit_LSM303_Accel_Unified(54321);
- Sragle1
- Posts: 5
- Joined: Sun Dec 10, 2017 7:01 pm
Re: LED sparkle skirt -HELP!!!
Ok, that resolved the error, but now I am gettig another error:
Programmer Type : butterfly
Description : Atmel AppNote AVR109 Boot Loader
Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = ")"; type = @
Software Version = :.u; Hardware Version = “.ð
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader
avrdude done. Thank you.
the selected serial port
does not exist or your board is not connected
Programmer Type : butterfly
Description : Atmel AppNote AVR109 Boot Loader
Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = ")"; type = @
Software Version = :.u; Hardware Version = “.ð
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader
avrdude done. Thank you.
the selected serial port
does not exist or your board is not connected
- adafruit2
- Posts: 22148
- Joined: Fri Mar 11, 2005 7:36 pm
Re: LED sparkle skirt -HELP!!!
hiya you have some issue uploading the code to the flora, check the flora guide to get uploading working!
we've also updated the guide with the new code here
https://learn.adafruit.com/sparkle-skirt/code-battery
we've also updated the guide with the new code here
https://learn.adafruit.com/sparkle-skirt/code-battery
Please be positive and constructive with your questions and comments.