View Single Post
  #1   Spotlight this post!  
Unread 03-12-2015, 03:44 PM
414cnewq 414cnewq is offline
Registered User
FRC #3844 (Kentucky Wildbots)
Team Role: Alumni
 
Join Date: Jul 2014
Rookie Year: 2014
Location: KY
Posts: 86
414cnewq has much to be proud of414cnewq has much to be proud of414cnewq has much to be proud of414cnewq has much to be proud of414cnewq has much to be proud of414cnewq has much to be proud of414cnewq has much to be proud of414cnewq has much to be proud of414cnewq has much to be proud of414cnewq has much to be proud of
Why isn't my slowdown working?

Okay. I have this code to add joystick sensitivity(it seems to work):
void joystickSanatizer(float*x, float*y){
//Pointers All the Way!!! #starmaster
if(*x<0){
*x*=*x;
*x*=0-1;
}
else *x*=*x;
if(*y<0){
*y*=*y;
*y*=0-1;
}
else *y*=*y;
}
in TeleopPeriodic:
float joyx=stick->GetRawAxis(0);
float joyy=stick->GetRawAxis(1);
joystickSanatizer(&joyx, &joyy);
if(stick->GetRawButton(10)){
multiplier=0.4;
}
else multiplier=1;
and then, after some unrelated code:
rBot->ArcadeDrive(joyy*multiplier, joyx*multiplier);
Where stick is an XBox 360 controller and rBot is a a RobotDrive object

The point of this code is to slow down the robot... but it doesn't.
Can someone help me fix this code or give me another way to slow down the robot.
Reply With Quote