I'm trying to experiment with a "return" function. Yet each time I try to run my program, there happens to be an error, like "expected declaration before '}' token."
Can someone explain the basics of a return function, and look at my code below to possibly see what the problem could be?
{
int index;
pinMode(10, INPUT); //button input
int checkInput();
if (digitalRead(10) == 0) {
return 1;
else{
return 0;
}
}
int checkInput();
supposed to achieve?return
isn't a function, it's a statement. In case the answers didn't make it clear, you changeint checkInput();
tocheckInput();