View unanswered posts | View active topics It is currently Thu Sep 18, 2014 3:53 am






Reply to topic  [ 2 posts ] 
data colletion 
Author Message
Rookie

Joined: Sat Oct 25, 2008 12:18 am
Posts: 19
Post data colletion
we have tried several sensors in our FTC trek- IRSeeker, Compass, Gyro, TETRIX motor encoders etc and have made them work. It is useful to see the global variables change, but now I am interested in getting the kids to actually store those global variables in a with time stamps associated, so we can see what our sensors are telling the microcontroller. This question actually came out of trying to use two VEX ultrasonic sensors and getting erratic results (mostly poor) - it appears that we were getting some cross talk or something. Anyway, this prompts the bigger question of how to store the global variables so we can review them later - both VEX and NxT (FTC). THANKS


Fri Feb 12, 2010 10:52 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post Re: data colletion
Hi Chuckmerja,

Robot C has a nice data logging feature for the NXT, it lets you save information to a text file on the nxt to be uploaded and reviewed later. Here is some code data logging code I made a looooong time ago, it should still work. Let me know if this is what you were looking for.

Also when using more than one sonar sensor at the same time, a ping that one sensor sends out may be read by the other sonar sensor and cause bad readings like you were exsperiencing. You may want to look into pinging one sensor at a time and reading the result before pinging the next sensor B-)

Good luck! hope this helps B-)

Code:
#pragma config(Sensor, S1,     LightSensor,         sensorLightInactive)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{

  const int MyDatalogSize = 84; // number of entries possible
  const long PoleRate = 30000;  // 5 minutes

  long Count = 0;
 
  // make the file
  CreateDatalog( MyDatalogSize );

  // add data to the file
  while(Count < MyDatalogSize)
  {
      AddToDatalog(Count, SensorValue[LightSensor]);
      PlayTone(2000, 1);

    wait1Msec(PoleRate);
     ++Count;
  }

  // when all done
   SaveNxtDatalog();
   PlaySound(soundFastUpwardTones);
   while (bSoundActive)
   {
      // wait until sound is complete
   }

   powerOff();

}

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Sat Feb 13, 2010 4:16 am
Profile WWW
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.