I am trying to make it so when a button is pressed (not pressing) it runs a void function a parameter. This does work when I do not use a parameter, but when I be I get the following error:
./main.cpp:19:34: error: cannot initialize a parameter of type 'void (*)()' with an rvalue of type 'void'
Controller1.ButtonX.released(centerActivate(SIG_1));
^~~~~~~~~~~~~~~~~~~~~
Here is the code:
bool currentlyCentered; vex::vision::signature currentSignature; bool objectCenter(); bool center(vex::vision::signature); void centerActivate(vex::vision::signature); int main() { while (true) { Controller1.ButtonX.released(centerActivate(SIG_1)); } } void centerActivate(vex::vision::signature currentSignature) { currentlyCentered = false; xCentered = false; yCentered = false; while (currentlyCentered == false) { currentlyCentered = center(currentSignature); } }