View unanswered posts | View active topics It is currently Sat Sep 26, 2020 8:45 am






Reply to topic  [ 3 posts ] 
Ranges for correlating stick movement to motor power 
Author Message
Rookie

Joined: Wed Aug 20, 2014 7:19 pm
Posts: 4
Post Ranges for correlating stick movement to motor power
Hello,

I am on a FTC team and I am pretty new to using RobotC. For our teleop system, we would like the ability to have multiple ranges for how much each movement unit for the sticks on our controller will correlate with the motor power units. What I would like to do is use the up and down buttons (the ones which are similar to arrow keys) for switching between the different power ranges. I would like some advice on how I should go about setting up this part of our program.

Also, we already have a teleop program which allows basic control of the robot.

Thanks.


Tue Aug 26, 2014 5:10 pm
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: Ranges for correlating stick movement to motor power
So, are you saying that you want your robot to have different max speeds depending on which mode you select? If so, you could have an array storing your different max speeds and store the currently selected mode stored in a variable. The mode variable would be incremented and decremented by the directional buttons. Then you just use the mode variable as the array index to get the correct max speed for your scaling calculation. I hope this makes sense!

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Wed Aug 27, 2014 9:34 am
Profile
Rookie

Joined: Wed Aug 20, 2014 7:19 pm
Posts: 4
Post Re: Ranges for correlating stick movement to motor power
BurningLights wrote:
So, are you saying that you want your robot to have different max speeds depending on which mode you select? If so, you could have an array storing your different max speeds and store the currently selected mode stored in a variable. The mode variable would be incremented and decremented by the directional buttons. Then you just use the mode variable as the array index to get the correct max speed for your scaling calculation. I hope this makes sense!


Your answer helped me come up with a solution. Thank you.


Thu Aug 28, 2014 2:08 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

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.