View unanswered posts | View active topics It is currently Tue Oct 21, 2014 4:49 pm






Reply to topic  [ 2 posts ] 
Data Logging 
Author Message
Rookie

Joined: Tue Nov 22, 2011 3:52 pm
Posts: 1
Post Data Logging
hi! i want to log the data but don't know how to like i need motor encoder values their speeds and sensor value i know the command AddToDatalog() but this isn't working for my case, i m doing it like:
task main
{
int s=10,svalue;
for(int i=0;i<10;i++)
{
svalue=SensorValue[Sonarsensor];
motor[motorB]=s;
motor[motorC]=s;
s=-s;
AddToDatalog(svalue);
AddToDatalog(motorB);
AddToDatalog(motorC);
AddToDatalog(nMotorEncoder[motorB]);
AddToDatalog(nMotorEncoder[motorC]);
}
SaveNxtDatalog();
}
but this is returnig me some garbage values i think its not correct can someone help me as early as possible i need motorB value in first column & motorC in 2 column and similarly if i want to give a title to that column then how can ... Any1 plz !!


Tue Nov 22, 2011 4:02 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Data Logging
If you simply want to see the data, you're probably better off using an array to store values. If you do want to use the data log, you're doing most things right. Just one thing, you need to add motor[MotorB] to the datalog, not just MotorB.
What do you mean that it's giving you garbage values? What is the output? As for the title and columns, that type of formatting isn't supported in ROBOTC. For that type of functionality, I recommend that you look at Aswin's NXT2excel program: http://nxttime.wordpress.com/2010/01/20/nxt2excel/

_________________
sudo rm -rf /


Tue Nov 22, 2011 6:26 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.