yamfe1:
the only error was using brackets instead of parenthesis, after correcting that the code compiled without any errors.
C:\stuff\SW\Arduino\_Others\Download\Tst\Tst.ino: In function 'int* setButtons()':
C:\stuff\SW\Arduino\_Others\Download\Tst\Tst.ino:8:33: warning: pointer to a function used in arithmetic [-Wpointer-arith]
buttons[i] = digitalRead[i];
^
C:\stuff\SW\Arduino\_Others\Download\Tst\Tst.ino:8:33: warning: invalid conversion from 'int (*)(uint8_t) {aka int (*)(unsigned char)}' to 'int' [-fpermissive]
C:\stuff\SW\Arduino\_Others\Download\Tst\Tst.ino:11:1: warning: control reaches end of non-void function [-Wreturn-type]
}
// int i; /////////////// Not used. A local variable of the same name is used
// int passTrue[9]; ///////// Declared but not used
int buttons[10]; ///////// You write into the 10th element so make the array long enough
void setButtons() /////////// No need to return a global variable since it is global
{
for (int i = 1; i<=9; ++i)
{
buttons[i] = digitalRead(i); ////////// Use '()' to call the digitalRead() function
// return buttons; /////////// YIKES! This will exit the function after reading Pin 1. The others will never get read.
}
}