Demo Program
Dependencies: LG1300L_IMU TextLCD mbed
Fork of LG1300L_Hello_World by
Diff: main.cpp
- Revision:
- 0:41a40e916d34
- Child:
- 1:99171a0e8301
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Mar 05 01:24:11 2013 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" +#include "TextLCD.h" +#include "LG1300L.h" + +TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7 + +Serial pc(USBTX, USBRX); // tx, rx + +I2C i2c(p28,p27); +DigitalOut LED (LED1); + +int main() { + LG1300L IMU(i2c, 2); + + while(1) { + float angle = IMU.GetAngle(); + float ROT= IMU.GetROT(); + float X_ACC = IMU.GetACC_X(); + float Y_ACC = IMU. GetACC_Y(); + float Z_ACC = IMU. GetACC_Z(); + pc.printf("///////////////////////////////////\n"); + pc.printf("//ANGLE: %f\n", angle); + pc.printf("//ROT: %f\n", ROT); + pc.printf("//X-Axis: %f\n", X_ACC ); + pc.printf("//Y-Axis: %f\n", Y_ACC ); + pc.printf("//Z-axis: %f\n", Z_ACC ); + pc.printf("///////////////////////////////////\n"); + wait(1); + } +} + \ No newline at end of file