NXC
Version 1.2.1 r5
Main Page
Related Pages
Modules
Data Structures
Files
Examples
All
Data Structures
Files
Functions
Variables
Groups
Pages
ex_ReadSensorHTAccel.nxc
This is an example of how to use the
ReadSensorHTAccel
function.
#ifndef DRAW_OPT_CLEAR_EOL
#define DRAW_OPT_CLEAR_EOL DRAW_OPT_NORMAL
#endif
task main() {
int
x, y, z;
SetSensorLowspeed
(
S2
);
while
(
true
) {
if
(
ReadSensorHTAccel
(
S2
, x, y, z)) {
#if DRAW_OPT_CLEAR_EOL == DRAW_OPT_NORMAL
ClearScreen
();
#endif
NumOut
(0,
LCD_LINE1
, x,
DRAW_OPT_CLEAR_EOL
);
NumOut
(0,
LCD_LINE2
, y,
DRAW_OPT_CLEAR_EOL
);
NumOut
(0,
LCD_LINE3
, z,
DRAW_OPT_CLEAR_EOL
);
}
}
}
Generated by
1.8.2