|
Revision 590, 0.5 KB
(checked in by atorf, 4 years ago)
|
- 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 | |
|---|
| 7 | task 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 | |
|---|