source: branches/atorf/NXC/TestAccelerator.nxc @ 1060

Revision 590, 526 bytes checked in by atorf, 5 years ago (diff)
  • Added some test demos and plots for accelerator (on the rocky road to position tracking…)
Line 
1
2#define PORT S1
3
4#define N 500
5
6
7task main() {
8
9     int x;
10     int y;
11     int z;
12     
13     int i;
14     
15     long startTick;
16     //bool dummy;
17
18
19
20     SetSensorLowspeed(PORT);
21
22     startTick = CurrentTick();
23     for (i = 0; i < N; i++) {
24          ReadSensorHTAccel(PORT, x, y, z);
25          //NumOut(0, LCD_LINE1, x, true);
26          //Wait(1);
27     }//end for
28     
29     NumOut(0, LCD_LINE3, (N * 1000) / (CurrentTick() - startTick), true);
30     Wait(2000);
31     
32}//end task
33
34
35
36
Note: See TracBrowser for help on using the repository browser.