We have a four motor arm deal thing going on with our robot, and we need help with the programming as everything except for the arm is working.
Here’s the programming (sorry that I have to copy and paste):
#pragma config(Motor, port1, rightDrive, tmotorVex393_HBridge, openLoop, reversed)
#pragma config(Motor, port2, rightDrive2, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port3, pincher1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, arm1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, arm2, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, arm3, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port7, arm4, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port8, pincher2, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port9, leftDrive2, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, leftDrive, tmotorVex393_HBridge, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
#pragma platform(VEX)
//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(120)
#include “Vex_Competition_Includes.c” //Main competition background code…do not modify!
/////////////////////////////////////////////////////////////////////////////////////////
// Pre-Autonomous Functions
//
// You may want to perform some actions before the competition starts. Do them in the
// following function.
/////////////////////////////////////////////////////////////////////////////////////////
void pre_auton()
{
// Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
// Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
bStopTasksBetweenModes = true;
// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, ...
}
/////////////////////////////////////////////////////////////////////////////////////////
// Autonomous Task
// This task is used to control your robot during the autonomous phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
/////////////////////////////////////////////////////////////////////////////////////////
task autonomous()
{
}
//////////////////////////////////////////////////////////////////////////////////////
// User Control Task
// This task is used to control your robot during the user control phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
/////////////////////////////////////////////////////////////////////////////////////////
task usercontrol()
{
while (1 ==1)
{
motor[leftDrive] = vexRT[Ch3] ;
motor[leftDrive2] = vexRT[Ch3] ;
motor[rightDrive] = vexRT[Ch2] ;
motor[rightDrive2] = vexRT[Ch2] ;
if(vexRT[Btn7U] == 1)
{
motor[pincher1] = 63;
motor[pincher2] = 127;
}
else if(vexRT[Btn7D] == 1)
{
motor[pincher1] = -63;
motor[pincher2] = -127;
}
else
{
motor[pincher1] = 0;
motor[pincher2] = 0;
}
}
if(vexRT[Btn5U] == 1)
{
motor[arm1] = 127;
motor[arm2] = 127;
motor[arm3] = 127;
motor[arm4] = 127;
}
else if(vexRT[Btn5D] == 1)
{
motor[arm1] = -127;
motor[arm2] = -127;
motor[arm3] = -127;
motor[arm4] = -127;
}
else
{
motor[arm1] = 0;
motor[arm2] = 0;
motor[arm3] = 0;
motor[arm4] = 0;
}
}