Hi
wonder if I can get some help / guidance.
I'm trying to upload a sketch by 'Mick the Mechanic' for a gearshift indicator.
It measures RPM and lights up neopixels accordingly.
Code LOOKS OK - but trying to verify it for a nano (which it was written for) I get the error:-
error: 'class Adafruit_NeoPixel' has no member named 'fill'
pixels.fill(pixels.Color(120, 0, 0));
several times in the code.
NeoPixel DOES have a 'member' named "fill" ...
Any suggestions ???
Thanks,
frustrated in Scotland
Welcome to the forum
stuart_m:
Code LOOKS OK -
What code would that be ?
But is it's function definition the same as the one that the code is using ? Same parameters ? Same data types ?
Yes - there is a fill with 3 parameters. You use one!
/*!
@brief Fill all or part of the NeoPixel strip with a color.
@param c 32-bit color value. Most significant byte is white (for
RGBW pixels) or ignored (for RGB pixels), next is red,
then green, and least significant byte is blue. If all
arguments are unspecified, this will be 0 (off).
@param first Index of first pixel to fill, starting from 0. Must be
in-bounds, no clipping is performed. 0 if unspecified.
@param count Number of pixels to fill, as a positive value. Passing
0 or leaving unspecified will fill to end of strip.
*/
void Adafruit_NeoPixel::fill(uint32_t c, uint16_t first, uint16_t count) {
Are you sure you have the latest (or at least recent) version installed? You would have to have a pretty old version if it does not have fill().
All of them have default values.
void fill(uint32_t c = 0, uint16_t first = 0, uint16_t count = 0);
Incorrect parameters would not give a "has no member named 'fill'" error.
Assuming that I have found the right code at Gear_Indicator/GearIndicator.ino at main · MickTheMechanic/Gear_Indicator · GitHub then it compiles for me
Please post the full output of your attempt to compile it so that we can see exactly which libraries and their versions you are using
Thanks all for your responses.
My original intent was to "hack" the code to meet my own requirements - but once I started to get the 'fill' error I went back to the original code - and I still get the same error - which is puzzling since it is a tried and tested piece of code.
I assume this means I have managed somehow to upset my IDE setup
I have tried in both the trad IDE and IDE2 - same result.
All files/libraries/IDEs have been updated to latest ver.
My error report follows:-
type or paste code here
Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"
type or paste code here
D:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Stuart\AppData\Local\Arduino15\packages -tools D:\Program Files (x86)\Arduino\tools-builder -tools D:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Stuart\AppData\Local\Arduino15\packages -built-in-libraries D:\Program Files (x86)\Arduino\libraries -libraries D:\Users\Stuart\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328old -ide-version=10813 -build-path C:\Users\Stuart\AppData\Local\Temp\arduino_build_920636 -warnings=none -build-cache C:\Users\Stuart\AppData\Local\Temp\arduino_cache_342961 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -verbose D:\Users\Stuart\Documents\Arduino\gearshiftlight\gearshiftlight.ino
D:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware D:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Stuart\AppData\Local\Arduino15\packages -tools D:\Program Files (x86)\Arduino\tools-builder -tools D:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Stuart\AppData\Local\Arduino15\packages -built-in-libraries D:\Program Files (x86)\Arduino\libraries -libraries D:\Users\Stuart\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328old -ide-version=10813 -build-path C:\Users\Stuart\AppData\Local\Temp\arduino_build_920636 -warnings=none -build-cache C:\Users\Stuart\AppData\Local\Temp\arduino_cache_342961 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -verbose D:\Users\Stuart\Documents\Arduino\gearshiftlight\gearshiftlight.ino
Using board 'nano' from platform in folder: C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\Stuart\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Detecting libraries used...
"C:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\eightanaloginputs" "C:\\Users\\Stuart\\AppData\\Local\\Temp\\arduino_build_920636\\sketch\\gearshiftlight.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for Adafruit_NeoPixel.h: [Adafruit_NeoPixel]
ResolveLibrary(Adafruit_NeoPixel.h)
-> candidates: [Adafruit_NeoPixel]
"C:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\eightanaloginputs" "-ID:\\Users\\Stuart\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\Users\\Stuart\\AppData\\Local\\Temp\\arduino_build_920636\\sketch\\gearshiftlight.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\eightanaloginputs" "-ID:\\Users\\Stuart\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "D:\\Users\\Stuart\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel\\Adafruit_NeoPixel.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Generating function prototypes...
"C:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\eightanaloginputs" "-ID:\\Users\\Stuart\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\Users\\Stuart\\AppData\\Local\\Temp\\arduino_build_920636\\sketch\\gearshiftlight.ino.cpp" -o "C:\\Users\\Stuart\\AppData\\Local\\Temp\\arduino_build_920636\\preproc\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE
"D:\\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\\Stuart\\AppData\\Local\\Temp\\arduino_build_920636\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Stuart\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\eightanaloginputs" "-ID:\\Users\\Stuart\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\Users\\Stuart\\AppData\\Local\\Temp\\arduino_build_920636\\sketch\\gearshiftlight.ino.cpp" -o "C:\\Users\\Stuart\\AppData\\Local\\Temp\\arduino_build_920636\\sketch\\gearshiftlight.ino.cpp.o"
D:\Users\Stuart\Documents\Arduino\gearshiftlight\gearshiftlight.ino: In function 'void loop()':
gearshiftlight:160:16: error: 'class Adafruit_NeoPixel' has no member named 'fill'
pixels.fill(pixels.Color(0, 0, 120)); //LEDs flash
^~~~
gearshiftlight:164:16: error: 'class Adafruit_NeoPixel' has no member named 'fill'
pixels.fill(pixels.Color(0, 0, 0));
^~~~
gearshiftlight:181:14: error: 'class Adafruit_NeoPixel' has no member named 'fill'
pixels.fill(pixels.Color(0, 0, 0));
^~~~
gearshiftlight:207:12: error: 'class Adafruit_NeoPixel' has no member named 'fill'
pixels.fill(pixels.Color(0, 0, 120)); //shift flash=blue
^~~~
gearshiftlight:211:12: error: 'class Adafruit_NeoPixel' has no member named 'fill'
pixels.fill(pixels.Color(0, 0, 0));
^~~~
gearshiftlight:219:12: error: 'class Adafruit_NeoPixel' has no member named 'fill'
pixels.fill(pixels.Color(120, 0, 0)); //overrev flash=red
^~~~
gearshiftlight:223:12: error: 'class Adafruit_NeoPixel' has no member named 'fill'
pixels.fill(pixels.Color(0, 0, 0));
^~~~
Using library Adafruit_NeoPixel in folder: D:\Users\Stuart\Documents\Arduino\libraries\Adafruit_NeoPixel (legacy)
exit status 1
'class Adafruit_NeoPixel' has no member named 'fill'
`'''`
Confused :slight_smile: :slight_smile: :slight_smile:
b707
November 17, 2022, 10:59am
7
The error diagnostic the same as above.
Are you sure that really uploaded the original code in the board rather the uploading your wrong code again?
Please show the link to original code
Hi
yep confident, link to code as per UKHeliBob above.
The first thing that I would do is to delete the library and install it again
That "(legacy)" part and the lack of a version number is very suspicious.
It should look something like this:
Using library Adafruit_NeoPixel at version 1.10.6 in folder: C:\...
I had re-updated the library - but agreed the 'legacy' looks suspicious.
Pretty sure I've broken my IDE by moving stuff about.
Right - delete and start again I think
Thanks all for your input.
Cheers
b707
November 17, 2022, 5:13pm
12
Not in that case.
"Legacy" warning in case the arduino libraries means that the library doesn't has src folder. It's all.
The latest version of Adafruit_NeoPixel is 1.10.6 and it source is not in src dir, so it will be labeled as "legacy" in IDE output
Nope.
"Legacy" means that the library does not have a library.properties file.
Thanks all - you gave me confidence that I wasn't going crazy, and eventually - after deleting the IDE and re-installing - and then searching out all the hidden files it leaves behind ( ) I had a fresh install which works fine
Appreciate your time and your help.
Cheers