Quote:
Originally Posted by windtakers
I have another question. if i want to record the joystick movements,X and Y, how would i get that data into the write text file, or is it better to use a spreadsheet. If so how would i get the data into the spread sheet. also i'm planning on having the data be written in the periodic tasks.
|
In this case, I (personally) would use the Write to Spreadsheet File VI, if only because this type of data can be put into an array nicely and it's less work on the coding end (However, you can use any of the other methods and still have it work, but this would be the best/simplest).
To do that, start by putting a Joystick Get inside a loop in Periodic Tasks and unbundle the "axes" output. Then, use a Build Array (in the array palate) to make an array of the X and Y axes. You will also want to have some kind of time identifier in the array as well. Off the top of my head, the best way to do this would be to use FPGA Time VI (found in WPI Robotics Library -> Utilities). Then, you can wire this array to the 1D array input on the Write to Spreadsheet File VI (make sure it's set to append the file, not to replace it; it's a boolean input). Also, make sure there's some sort of timing on your while loop, as to not waste resources by writing files as fast as possible (maybe every 250 ms would be a good time).
Although it would probably be easier for me to just give you a VI for this, I'm not going to. One of the funny things about programming is that you actually learn best by writing things yourself. So, try to write this on your own, and if you need help, I'll help you through it.