Announcement

Collapse
No announcement yet.

Teleop Issues

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Teleop Issues

    Below is code for our remote to lift a motor to two specific positions using teleop mode. But now the other buttons are not working. I thought I could program in teleop and all other buttons would remain the same commands? We also want to use the top left and right buttons to move our middle motor. This is our first time to use teleop to program our remote. We use tank control, we are wondering if I need to specify somewhere in the code?


    #pragma config(Sensor, port2, gyroSensor, sensorVexIQ_Gyro)
    #pragma config(Sensor, port3, colorSensorLeft, sensorVexIQ_ColorGrayscale)
    #pragma config(Motor, motor1, leftMotor, tmotorVexIQ, openLoop, driveLeft, encoder)
    #pragma config(Motor, motor5, middleMotor, tmotorVexIQ, PIDControl, encoder)
    #pragma config(Motor, motor6, rightMotor, tmotorVexIQ, openLoop, reversed, driveRight, encoder)
    #pragma config(Motor, motor11, elelift, tmotorVexIQ, PIDControl, encoder)
    //YOU HAVE TO START THE ROBOT AT WALL LEVEL
    task main()
    {
    while(true)
    {
    if(getJoystickValue(BtnFUp)) //F Button up the basket goes up to post level -
    {
    setMotorTarget(motor11,2000,75); //highest height of basket it will get on the post 2000 is the highest
    }
    else if (getJoystickValue(BtnFDown)) //when you push F Button down the basket goes down to solid color level


    setMotorTarget(motor11,-2000,75); //lowest basket to get on low one color posts
    }

    setMotorSpeed(motor11,0);

    if (getJoystickValue(BtnLUp))

    setMotorSpeed(motor5,10);
    else

    setMotorSpeed(motor5,0);

    if (getJoystickValue(BtnRUp))
    setMotorSpeed(motor5,100);
    }





Working...
X