so new to the forum and trying to make joysticks work with bot but it always gives me two errors of the same thing, what is wrong?
help is greatly appreciated.
here is all my code lines |
/
#pragma config(Motor, mtr_Matrix_S1_1, FLMotor, tmotorTetrix, PIDControl, reversed, encoder)
#pragma config(Motor, mtr_Matrix_S1_2, FRMotor, tmotorTetrix, PIDControl, encoder)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
#pragma debuggerWindows(“joystickSimple”);
#include “JoystickDriver.c”
task main()
{
while(true) //Loop Forever
//Get the Latest joystick values
getJoystickSettings(joystick);
//Driving Control
//left y
if(abs(joystick.joy1_y1) > 3)
motor[FRMotor] = joystick.joy1_y1;
motor[FLMotor] = joystick.joy1_y1;
{
motor[FLMotor] = 0;
motor[FRMotor] = 0;
//right x
if(abs(joystick.joy1_x2) > 3) //
motor[FRMotor] = -joystick.joy1_x2;
motor[FLMotor] = joystick.joy1_x2;
}
motor[FLMotor] = 0;
motor[FRMotor] = 0;
}
//Infinite Loop
while(true)
//If button 6 (right bumper) is pressed
if(joy1Btn(06) == 1)
{
//Raise the arm
motor[PORT7] = 100;
}
//Else, if button 8 (right trigger) is pressed
else if(joy1Btn(08) == 1)
{
//Lower the arm
motor[PORT7] = -100;
}
//Else (no button pressed)
else if(joy1Btn(08) == 0)
{
//Turn the arm motor off
motor[PORT7] = 0;
}
{
//Infinite Loop
while(true)
//If button 5 (left bumper) is pressed
if(joy1Btn(05) == 1)
{
//Open the claw
motor[PORT6] = 100;
}
//Else, if button 7 (left trigger) is pressed
else if(joy1Btn(07) == 1)
{
//Close the claw
motor[PORT6] = -100;
}
//Else (no button pressed)
else if(joy1Btn(07) == 0)
{
//Turn the arm motor off
motor[PORT6] = 0;
}
}