View unanswered posts | View active topics It is currently Fri Jul 11, 2014 7:14 am






Reply to topic  [ 4 posts ] 
How to check the current value of the motor encoder? 
Author Message
Rookie

Joined: Mon Nov 03, 2008 1:11 am
Posts: 5
Post How to check the current value of the motor encoder?
How do I check the current value of a DC motor encoder, and then save it into a variable?

I have like no idea how to do this.. :?

_________________
I am a Member of FTC team Flaming Cup noodles, team # 2869.


Fri Dec 26, 2008 3:46 pm
Profile
Novice

Joined: Thu Oct 09, 2008 7:58 pm
Posts: 79
Post Re: How to check the current value of the motor encoder?
Well, first, be sure that the encoders are calculated in clicks, and the number of clicks is that essentially gets you the "position".

But there is a function for getting the number of clicks the encoder is on.

for a motor named MotorD, the function would be nMotorEncoder[MotorD];
so if you are doing it like a variable, it would be.

int x = nMotorEncoder[MotorD]; // where x is the variable.

For a full list of functions and other things, use the following link: http://www.education.rec.ri.cmu.edu/con ... _Guide.pdf


Sat Dec 27, 2008 1:33 pm
Profile
Rookie

Joined: Mon Nov 03, 2008 1:11 am
Posts: 5
Post Re: How to check the current value of the motor encoder?
How do i do this for a servomotor?

_________________
I am a Member of FTC team Flaming Cup noodles, team # 2869.


Sat Dec 27, 2008 3:14 pm
Profile
Novice

Joined: Thu Oct 09, 2008 7:58 pm
Posts: 79
Post Re: How to check the current value of the motor encoder?
:D, by you asking that question told me that you did not look at the link I presented. Please go to the link: http://www.education.rec.ri.cmu.edu/con ... _Guide.pdf . It has a lot of valuable information.

None the less I will still answer your question. For a servo name ServoD and a variable x. The line of code would be

int x = ServoValue[ServoD];

The ServoValue[ServoD] is the function you use to check the number of clicks for a servo encoder.


Sat Dec 27, 2008 8:48 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 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.