Simplified L3GD20 demos
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9461 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
cb24fff73c
commit
c9387af734
|
@ -130,26 +130,13 @@ int main(void) {
|
||||||
l3gd20Start(&L3GD20D1, &l3gd20cfg);
|
l3gd20Start(&L3GD20D1, &l3gd20cfg);
|
||||||
|
|
||||||
while(!palReadLine(LINE_BUTTON)){
|
while(!palReadLine(LINE_BUTTON)){
|
||||||
palToggleLine(LINE_LED10_RED);
|
chprintf(chp, "Press BTN to calibrate gyroscope...\r\n");
|
||||||
gyroscopeReadRaw(&L3GD20D1, rawdata);
|
|
||||||
for(i = 0; i < L3GD20_NUMBER_OF_AXES; i++)
|
|
||||||
chprintf(chp, "RAW-%c:%d\r\n", axesID[i], rawdata[i]);
|
|
||||||
|
|
||||||
gyroscopeReadCooked(&L3GD20D1, cookeddata);
|
|
||||||
for(i = 0; i < L3GD20_NUMBER_OF_AXES; i++)
|
|
||||||
chprintf(chp, "COOKED-%c:%.3f\r\n", axesID[i], cookeddata[i]);
|
|
||||||
|
|
||||||
gyroscopeGetTemp(&L3GD20D1, &temperature);
|
|
||||||
chprintf(chp, "TEMP:%.1f C°\r\n", temperature);
|
|
||||||
|
|
||||||
chprintf(chp, "Press Button to continue...\r\n");
|
|
||||||
chThdSleepMilliseconds(150);
|
chThdSleepMilliseconds(150);
|
||||||
#if CHPRINTF_USE_ANSI_CODE
|
#if CHPRINTF_USE_ANSI_CODE
|
||||||
chprintf(chp, "\033[2J\033[1;1H");
|
chprintf(chp, "\033[2J\033[1;1H");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
palClearLine(LINE_LED10_RED);
|
|
||||||
chprintf(chp, "Calibrating Gyroscope sampling bias...\r\n");
|
chprintf(chp, "Calibrating Gyroscope sampling bias...\r\n");
|
||||||
chprintf(chp, "Keep it in the rest position while red LED is on\r\n");
|
chprintf(chp, "Keep it in the rest position while red LED is on\r\n");
|
||||||
chThdSleepMilliseconds(3000);
|
chThdSleepMilliseconds(3000);
|
||||||
|
|
Loading…
Reference in New Issue