function not declared in scope
this program (not finished can see):
when compile code "in function 'void setup()': error: 'setcolorinterval' not declared in scope".
even when move function call setup loop() still gives me error loop. why getting error?
code: [select]
// constants
const char state_default = 'a';
// environment variables
long currenttime = 0;
char state = state_default;
int redinterval = 0;
int blueinterval = 0;
int greeninterval = 0;
long redstarttime = 0;
long bluestarttime = 0;
long greenstarttime = 0;
void setup()
{
serial.begin(9600);
setcolorinterval(redstarttime, redinterval);
setcolorinterval(bluestarttime, blueinterval);
ssetcolorinterval(greenstarttime, greeninterval);
}
void loop()
{
}
void setcolorinterval(long &starttime, int &interval, int mininterval, int maxinterval)
{
if((starttime == 0) || (currenttime - starttime >= interval))
{
interval = random(mininterval, maxinterval);
starttime = currenttime;
}
}
void setcolorinterval(long &starttime, int &interval)
{
setcolorinterval(starttime, interval, 0, 10000);
}
when compile code "in function 'void setup()': error: 'setcolorinterval' not declared in scope".
even when move function call setup loop() still gives me error loop. why getting error?
setcolorinterval defined after call it, in either setup or loop.
move function up, before setup and/or loop, , problem go away.
move function up, before setup and/or loop, , problem go away.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > function not declared in scope
arduino
Comments
Post a Comment