Go to Post Work hard. Then work even harder. Work until there is nothing left to work on, then work more. - RoboChair [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:30 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi