-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMacro.nxc
27 lines (26 loc) · 806 Bytes
/
Macro.nxc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Set definitions for the file that data will be written to
#define RECORDS 2000
#define RECORD_SIZE 6
#define FILE_SIZE (RECORD_SIZE * RECORDS)
#define FILE_NAME "movement.dat"
// include a file full of functions for using files easily.
#include "file_system.nxc"
task main()
{
// Create an instance of the 'movement' class, called 'm'
movement m;
// Open the file for writing (see the 'file_system.nxc' file for the function
open_for_write();
// Infinite loop until program is ended
while(true)
{
// Write the relevant values to the 'm' class
update_movement(m);
// Add copy of movement data for this loop to the file
write_recd(m);
// So values don't accumulate over loops
ResetTachoCount(OUT_AC);
// Lower amount of data written to file and increase reliability
Wait(20);
}
}