![]() |
[FTC]: DC MotorEncoder Code
So in the instance of having servos, those servos have set positions you can send them to. What I want to do is tell a motor to go to specific encoder positions in robotC. I haven't the slightest clue how to begin doing that. My goal is to push a button and have an arm powered by a motor go to a certain position and stop or keep a low level of power to keep it locked in that position until the button isn't pressed.
Thank You. John Fogarty |
Re: [FTC]: DC MotorEncoder Code
Here's one way to do it:
Have the motor move back until it hits a touch sensor. Set the input from the encoder as the zero position (store it in a variable) and move the motor forward to the encoder position you want, plus the zero value. We did this to align a dispenser tread on our old robot. If it doesn't rotate all the way around, you may not have to do this. |
Re: [FTC]: DC MotorEncoder Code
Oh, actually, you could just reset the encoder using the software when it hits the touch sensor. Sorry, I'm a hardware guy. I was unsure about my last post, so I read our team's own tutorial on using them. :p
http://say-watt.org/wp2/archives/391 |
Re: [FTC]: DC MotorEncoder Code
Code:
nMotorEncoder[motorA] = 0; |
Re: [FTC]: DC MotorEncoder Code
another way thats a bit more direct but probably a little bit less reliable in terms of skidding:
Code:
motor[FL] = power; |
| All times are GMT -5. The time now is 19:07. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi