Go Down

Topic: Arduino code not working - beginner needs help (Read 671 times) previous topic - next topic

idna001


Hello,


I tried to copy this Project on GitHub ( https://github.com/GitTibbe/LED-Strip-HomeKit-Driver ),
but I get the following error message:

The Arduino Code can't upload to my UNO.
its saying "colour" is not declared
See the following information below.

Anybody who has any idea what I can do?

thank you in advance for every hint.

Andreas



Arduino: 1.8.7 (Mac OS X), Board: "Arduino/Genuino Uno"

homekit_arduino:77:24: error: expected ',' or '...' before 'colors'
void changeColor(int[3]colors, int[3]prevColors){
^
/Users/arv001/Desktop/homekit_arduino/homekit_arduino.ino: In function 'void loop()':
homekit_arduino:59:8: error: expected unqualified-id before '[' token
int[3] prevColors = [rPrev, gPrev, bPrev]; //array with previous color values
^
homekit_arduino:65:8: error: expected unqualified-id before '[' token
int[3] colors = [r,g,b]; //array with color values
^
homekit_arduino:71:17: error: 'colors' was not declared in this scope
changeColor(colors, prevColors);
^
homekit_arduino:71:25: error: 'prevColors' was not declared in this scope
changeColor(colors, prevColors);
^
/Users/arv001/Desktop/homekit_arduino/homekit_arduino.ino: At global scope:
homekit_arduino:77:24: error: expected ',' or '...' before 'colors'
void changeColor(int[3]colors, int[3]prevColors){
^
/Users/arv001/Desktop/homekit_arduino/homekit_arduino.ino: In function 'void changeColor(int*)':
homekit_arduino:79:15: error: 'colors' was not declared in this scope
int diffR = colors[0]-prevColors[0];
^
homekit_arduino:79:25: error: 'prevColors' was not declared in this scope
int diffR = colors[0]-prevColors[0];
^
exit status 1
expected ',' or '...' before 'colors'
 

AWOL

Quote
Anybody who has any idea what I can do?

You could post your code.
In code tags.

Delta_G

#2
Jan 20, 2019, 07:24 pm Last Edit: Jan 20, 2019, 07:25 pm by Delta_G
Code: [Select]
int[3] colors = [r,g,b];


Code: [Select]
int colors[3] = [r,g,b];


You can't just make up your own syntax.  That never works.  You have to take the time to study what is expected. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

slipstick

The Arduino Code can't upload to my UNO.
its saying "colour" is not declared
No it isn't. It is saying "color" is not declared. Spelling is important. It's easy to fall over the difference between US and UK spelling but you have to choose one and stick with it.

Steve

idna001

Hello,

since I hadnĀ“t much time I forgot this project sorry. :smiley-confuse:
Thanks for the answers anyway.

I cancelled that project with that Code, because the Files have obviously too many bugs.

Hopefully i will find a better one. Hints are welcome. :)

Kind regards
idna

Go Up