SimpleDataCollection
How To Collect Data Using the Cricket
The Cricket can collect up to 2,500 data points. This can be 2,500 samples of an individual sensor, or 1,250 samples of a pair of sensors, or some other combination.
To collect data, use the record
primitive. For example, the following program will record 100 samples of sensora
, at a rate of 1 sample per second.
to sample resetdp repeat 100 [record sensora wait 10] end
Notice the use of the resetdp
command before the data is collected. This command resets the data pointer to the beginning of the buffer. You can think of this as like "rewinding the cassette tape" to the beginning. Then the rest of the program collects the 100 points, with a 1-second delay (wait 10
) between each sample.
To upload the data, go into the Cricket menu and choose Upload Data. For this experiment, you would then fill in
- Data Points to Upload, 100 (since you recorded 100 total points)
- Points Per Line, 1 (since just Sensor A is being sampled)
Then click "Upload Data From Cricket." After it finishes, click "Save Data To File." This will create a text file (with a .txt
extension).
You can open the text file to view the data, or load it into a spreadsheet program to graph it.