git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3703 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
b89c65bd8d
commit
12ba4080d6
|
@ -266,14 +266,14 @@ int main(void) {
|
||||||
* driver 2.
|
* driver 2.
|
||||||
*/
|
*/
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
uint8_t x, y, z;
|
int8_t x, y, z;
|
||||||
|
|
||||||
if (palReadPad(GPIOA, GPIOA_BUTTON))
|
if (palReadPad(GPIOA, GPIOA_BUTTON))
|
||||||
TestThread(&SD2);
|
TestThread(&SD2);
|
||||||
|
|
||||||
x = lis302dlReadRegister(&SPID1, LIS302DL_OUTX);
|
x = (int8_t)lis302dlReadRegister(&SPID1, LIS302DL_OUTX);
|
||||||
y = lis302dlReadRegister(&SPID1, LIS302DL_OUTY);
|
y = (int8_t)lis302dlReadRegister(&SPID1, LIS302DL_OUTY);
|
||||||
z = lis302dlReadRegister(&SPID1, LIS302DL_OUTZ);
|
z = (int8_t)lis302dlReadRegister(&SPID1, LIS302DL_OUTZ);
|
||||||
chprintf((BaseChannel *)&SD2, "%d, %d, %d\r\n", x, y, z);
|
chprintf((BaseChannel *)&SD2, "%d, %d, %d\r\n", x, y, z);
|
||||||
chThdSleepMilliseconds(500);
|
chThdSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue