View unanswered posts | View active topics It is currently Thu Sep 19, 2019 5:05 am






Reply to topic  [ 1 post ] 
TETRIX motors and joysticks 
Author Message
Rookie

Joined: Mon Dec 28, 2009 7:28 am
Posts: 1
Post 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


Sat Jan 09, 2010 10:46 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.