/*----------------------------------------------------------------------------*/
/* */
/* Module: main.cpp */
/* Author: {author} */
/* Created: {date} */
/* Description: V5 project */
/* */
/*----------------------------------------------------------------------------*/
// Include the V5 Library
#include "vex.h"
// Allows for easier use of the VEX Library
using namespace vex;
vex::motor intakes[6] = { Motor14, Motor12, Motor9, Motor3, Motor2, Motor7 };
competition comp;
void StartIntakesF(){
for (int i = 0; i < 6; i++){
intakes[i].spin(forward);
}
}
void StartIntakesB(){
for (int i = 0; i < 6; i++){
intakes[i].spin(reverse);
}
}
void StopIntakes(){
if (!Controller1.ButtonR1.pressing()&&!Controller1.ButtonL1.pressing()){
for (int i = 0; i < 6; i++){
intakes[i].stop();
}
}
}
void driver(){
Controller1.ButtonR1.pressed(StartIntakesF);
Controller1.ButtonR1.released(StopIntakes);
Controller1.ButtonL1.pressed(StartIntakesB);
Controller1.ButtonL1.released(StopIntakes);
}
void auton(){
while (true){
Vision18.takeSnapshot("SIG_1");
if (Vision18.largestObject.centerX>158){
Drivetrain.turn(left);
}else if (Vision18.largestObject.centerX<158){
Drivetrain.turn(right);
} else {
Drivetrain.stop();
}
}
}
int main() {
for (int i = 0; i < 6; i++){
intakes[i].setVelocity(999, percent);
}
comp.autonomous(auton);
comp.drivercontrol(driver);
while (true){
wait(0.5, seconds);
}
}
Iām trying to do a basic āfollow the ballā script but for some reason the compiler isnāt recognizing the takeSnapshot function, any help?