ROBOTC.net forums
http://robotc.net/forums/

TETRIX motors and joysticks
http://robotc.net/forums/viewtopic.php?f=1&t=2093
Page 1 of 1

Author:  Robmaister [ Sat Jan 09, 2010 10:46 pm ]
Post subject:  TETRIX motors and joysticks

I am programming for my FTC team and I have been running into an issue with both my drive train and our arm. I tell a motor to move at a certain speed after checking to see if a joystick has surpassed a certain position, but it seems to be moving far faster than what it would if I were to make it an autonomous program, which I have tested to be true. I am assuming the motor assumes 100% speed when in User Control mode with a joystick.

What is the issue and how can I get my arm motors to move slower with a joystick?

Here is a test program I put together quickly to test the arme:
Code:
#pragma config(Hubs,  S1, HTMotor,  HTServo,  none,     none)
#pragma config(Motor,  mtr_S1_C1_1,     motorD,        tmotorNormal, PIDControl, encoder)
#pragma config(Motor,  mtr_S1_C1_2,     motorE,        tmotorNormal, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"  //Include file to "handle" the Bluetooth messages.

void initializeRobot()
{
  // Place code here to sinitialize servos to starting positions.
  // Sensors are automatically configured and setup by ROBOTC. They may need a brief time to stabilize.

  return;
}

task main()
{
  initializeRobot();

  waitForStart(); // Wait for the beginning of autonomous phase.

  while (true)
  {
      getJoystickSettings(joystick);
      if (joystick.joy1_y1>50) {
        motor[motorD]=-1;
      }
      if (joystick.joy1_y1<-50) {
        motor[motorD]=2;
      }
      if (joystick.joy1_y2>50) {
        motor[motorE]=-20;
      }
      if (joystick.joy1_y2<-50) {
        motor[motorE]=20;
      }
  }
}


Thanks,
Robert Rouhani

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/