Hi all.
I recently completed the Infinity Mirror V1 project using a particle photon and decided to take a crack at making my own using an Adafruit Trinket 5V. I have the Arduino IDE setup correctly (I think) with the latest Neopixel library and the Board manager pointing toward the Trinket ATtiny85 @ 16Mhz & USBtinyISP programmer.
I have coped the code from the V2 page (https://core-electronics.com.au/guides/digital-electronics/infinity-mirror-kit-v2-assembly-instructions/) however when I verify it returns the following error:
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Adafruit Trinket (ATtiny85 @ 16MHz)"
Trinket_Code:74:44: error: expected primary-expression before '(' token
Adafruit_NeoPixel strip = Adafruit_NeoPixel(num_leds, strip_pin, NEO_GRB NEO_KHZ800);
^
In file included from C:\Users\Dean\Documents\Arduino\Trinket_Code\Trinket_Code.ino:26:0:
C:\Users\Dean\Documents\Arduino\libraries\Adafruit_NeoPixel/Adafruit_NeoPixel.h:136:20: error: expected ')' before numeric constant
#define NEO_KHZ800 0x0000 ///< 800 KHz data transmission
^
C:\Users\Dean\Documents\Arduino\Trinket_Code\Trinket_Code.ino:74:76: note: in expansion of macro 'NEO_KHZ800'
Adafruit_NeoPixel strip = Adafruit_NeoPixel(num_leds, strip_pin, NEO_GRB NEO_KHZ800);
^~~~~~~~~~
C:\Users\Dean\Documents\Arduino\Trinket_Code\Trinket_Code.ino: In function 'void drawComet(int, byte)':
Trinket_Code:196:45: error: expected ')' before 'pos'
strip.setPixelColor(strip.numPixels() pos-i, strip.Color(R,G,B));
^~~
C:\Users\Dean\Documents\Arduino\Trinket_Code\Trinket_Code.ino: In function 'void rainbow()':
Trinket_Code:219:69: error: expected ')' before 'j'
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) j) & 255));
^
Trinket_Code:219:79: error: expected ')' before ';' token
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) j) & 255));
^
Using library Adafruit_NeoPixel at version 1.10.4 in folder: C:\Users\Dean\Documents\Arduino\libraries\Adafruit_NeoPixel
exit status 1
expected primary-expression before '(' token
I’m really quite terrible at programming so I’m not sure how to resolve this problem.
Any suggestions would be appreciated.
Thanks!
1 Like
Hi Dean,
Welcome to the forum 
At a quick glance, those look like syntax errors where the compiler is expecting a formula to have a number of arguments then receiving less than that or something that doesn’t look like what it’s expecting.
I think you are missing commas between the arguments being passed into your functions.
For example:

Try adding a comma where I’ve put the red arrow then recompile. Make only one change at a time, then recompile and see if you get one less error message. Then tackle the next error bit by bit until the compiler is happy with what you are sending it.
1 Like
Hi Trent,
Unfortunately that didn’t work. It seemed to open a whole new barrel of fun error messages
C:\Users\Dean\Documents\Arduino\Trinket_Code\Trinket_Code.ino: In function 'void drawComet(int, byte)':
Trinket_Code:196:71: error: no matching function for call to 'Adafruit_NeoPixel::setPixelColor(uint16_t, int, uint32_t)'
strip.setPixelColor(strip.numPixels(), pos-i, strip.Color(R,G,B));
In file included from C:\Users\Dean\Documents\Arduino\Trinket_Code\Trinket_Code.ino:26:0:
C:\Users\Dean\Documents\Arduino\libraries\Adafruit_NeoPixel/Adafruit_NeoPixel.h:227:8: note: candidate: void Adafruit_NeoPixel::setPixelColor(uint16_t, uint8_t, uint8_t, uint8_t)
void setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b);
At a guess, I think it may have something to do with this line:
Trinket_Code:74:44: error: expected primary-expression before '(' token
Adafruit_NeoPixel strip = Adafruit_NeoPixel(num_leds, strip_pin, NEO_GRB NEO_KHZ800);
// 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)
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(num_leds, strip_pin, NEO_GRB NEO_KHZ800);
The comments in the code do seem to make sense though, so I am still at a loss. It might be time to roll up my sleeves and actually try and learn some coding hah.
1 Like
The message means that the arguments you have provided do match match, either in type of variable, or in the number of arguments, to any of the various versions of setPixelColor that are defined in the library. The suggested candidate does not seem the most likely match. The one you have listed seems more likely, which means that strip.numPixels() must be a function that returns a uint16_t, pos-i must be a uint8_t and strip.Color(R,G,B) must be a function that returns a uint8_t. However it is also possible that you meant to match the function call to a different version of the library function, in which case the required variable types would be different.
2 Likes