View unanswered posts | View active topics It is currently Sun Dec 21, 2014 7:41 pm






Reply to topic  [ 2 posts ] 
Absolute Values for Quadrature Encoder Counts 
Author Message
Rookie

Joined: Wed Mar 06, 2013 1:22 pm
Posts: 3
Post Absolute Values for Quadrature Encoder Counts
I don't know if I am recalling this correctly; but isn't there a way to retreive the counts from the quadrature encoders as absolute values so that both positive and negative counts are shown as positive? I know that when we use the actual robots we can invert the cable connections at the microcontroller so that all forward movements increase the count (count up) and all backward movements decrease the count (count down), falling into negative numbers if they fall below zero. However, this cannot be done physically in RVW because there are no cable connections.

I've searched the Forum and have not been able to come up with a solution.

Thanks in advance for the help.


Mon May 06, 2013 12:04 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 619
Post Re: Absolute Values for Quadrature Encoder Counts
You should be able to by using the abs() command:

Code:
abs(SensorValue[rightEncoder])
abs(SensorValue[leftEncoder])


You can find more information on the absolute command (as well as other Math commands used in ROBOTC) on the ROBOTC wiki, found here: http://www.robotc.net/wiki/Math#abs

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Tue May 21, 2013 9:59 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 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:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.