ICM20602

Dependencies:   ICM20602_I2C

Files at this revision

API Documentation at this revision

Comitter:
kosukesuzuki
Date:
Fri Aug 19 23:41:25 2022 +0000
Commit message:
ICM20602_I2C

Changed in this revision

ICM20602_I2C.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 6b8b12c2b796 ICM20602_I2C.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ICM20602_I2C.lib	Fri Aug 19 23:41:25 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/kosukesuzuki/code/ICM20602_I2C/#a3a918003b88
diff -r 000000000000 -r 6b8b12c2b796 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Aug 19 23:41:25 2022 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "icm20602_i2c.h"
+
+ICM20602 icm20602;
+Serial pc(USBTX,USBRX);
+
+float acc[3];
+float gyro[3];
+    
+int main(){
+    
+    icm20602.init();
+    while(1){
+        acc[0] = icm20602.getAccXvalue();
+        acc[1] = icm20602.getAccYvalue();
+        acc[2] = icm20602.getAccZvalue();
+        gyro[0] = icm20602.getGyrXvalue();
+        gyro[1] = icm20602.getGyrYvalue();
+        gyro[2] = icm20602.getGyrZvalue();
+        
+        
+        pc.printf("%f %f %f %f %f %f\r\n",acc[0],acc[1],acc[2],gyro[0],gyro[1],gyro[2]);
+        wait_ms(100);
+        }
+    
+}
\ No newline at end of file