programe tcs3210 with arduino uno

hay guys
iam a newbie in using arduino..
now i have a project with arduino uno and colour sensor tcs3210 module

in creat a project i find a problem when a make a programed..
as error taos mode as sketch_may14c.ino: In function 'float colorRead(int, int, boolean)':
sketch_may14c:41: error: 'taosMode' was not declared in this scope
sketch_may14c.ino: At global scope:
sketch_may14c:103: error: expected unqualified-id before 'if'
sketch_may14c:110: error: expected unqualified-id before 'else'
sketch_may14c:116: error: expected unqualified-id before 'else'
sketch_may14c:122: error: expected unqualified-id before 'else'
sketch_may14c:127: error: expected unqualified-id before 'return'
sketch_may14c:128: error: expected declaration before '}' token
'taosMode' was not declared in this scope

please help me to fix that problem..
Thank you..

sketch_may14a.ino (2.57 KB)

Hi,
Is that the complete sketch, it looks like you should have included a library.
Have you googled

arduino tcs3210

There may be example programs for it, and they will have any libraries that you will need.

Tom.... :slight_smile:

This is the entire colorRead() function:

float colorRead(int taosOutPin, int color, boolean LEDstate){

//turn on sensor and use highest frequency/sensitivity setting

taosMode(1); 

int sensorDelay = 100;
}

Looks pretty useless, doesn't it?

Put the { on a new line, where it belongs, and properly indent your code. Then, it's much simpler to see that you are, apparently, prematurely ending the function.

All of the errors result from that one issue.