View unanswered posts | View active topics It is currently Wed Oct 22, 2014 3:59 am






Reply to topic  [ 2 posts ] 
Encoder debug stream 
Author Message
Rookie

Joined: Mon Jan 20, 2014 12:42 pm
Posts: 1
Post Encoder debug stream
Hi,

So I am using encoders in a matrix robot to run an autonomous program. I am having some slight issues with them so I want to write the encoder values to a debug stream. I can't figure out how to do this, so could anyone please help me. Even if it's just something I can try it would be great. Thanks so much for the help.


Mon Jan 20, 2014 12:45 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 592
Post Re: Encoder debug stream
This is a bare-bones version of the writing a single line to the Debug Stream window:

Code:
writeDebugStreamLine("Value: %d", nMotorEncoder[encoderName]);
wait1Msec(10);


Note that the %d parameter allows you to write a number directly (in this case, the value of an encoder) to the Debug stream but it is 'contained' at the location in the string that you would like for it to appear. The 10ms wait command is used to allow time for the Debug Stream window to refresh and update the information. You will want to put this in a control structure (such as a loop) if you would like to print more than one reading to the Debug Stream.

You can find more information on the Debug Stream here: http://www.robotc.net/wiki/Debug_Stream

_________________
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


Mon Jan 20, 2014 1:11 pm
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:  



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