I have some code and I have no idea why there are errors please help.
(this is c++ btw)
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
bool inertialon,inertialoff;
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
Inertial21.calibrate();
while(true){
if(Controller1.buttonup.pressed()){
turnon();
}
}
}
void turnon(){
inertialoff = true;
}
Haven’t really used much vexcode but for starters, you have a function in a function, it needs to be out of that scope. Same goes with your bools, they need to be in a global scope, not local to the int main function. (hopefully I’m not talking bs, if I said something stupid correct me).