View unanswered posts | View active topics It is currently Sat Oct 31, 2020 7:08 pm

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

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

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
Site Admin
Site Admin

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

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

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:

Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.

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