Hi. I’m trying Gadgetoid’s Arduino library on a Nano, which I’m coding in the Arduino IDE 1.6.9. However I’m having some issues. I’m a total novice at C - and pretty new to Arduinos generally, so it’s entirely possible I’ve just done something dumb. But I could do with some pointers please.
Firstly - I couldn’t get the sample code to compile without editing. In the PiGlow.h file the compiler was objecting to lines 16 to 18 where the leg arrays are defined;
PiGlow(){
leg0 = { 6, 7, 8, 5, 4, 9 } ;
leg1 = { 17, 16, 15, 13, 11, 10 } ;
leg2 = { 0, 1, 2, 3, 14, 12 } ;
…which gave the compiler error “error: assigning to an array from an initializer list”. But changing it to the following did allow it to compile.
PiGlow(){
int leg0[6] = { 6, 7, 8, 5, 4, 9 } ;
int leg1[6] = { 17, 16, 15, 13, 11, 10 } ;
int leg2[6] = { 0, 1, 2, 3, 14, 12 } ;
That may have been inappropriate, since - like I said I don’t know C well at all. And when that’s uploaded to the Arduino, all that happens is that the bottom left, red, LED on the PiGlow flickers. Just that one light.
Any idea why?
cheers,
Ben