jy901

Dependencies:   jy901

Files at this revision

API Documentation at this revision

Comitter:
piroro4560
Date:
Fri Oct 25 09:36:43 2019 +0000
Commit message:
jy901

Changed in this revision

jy901.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
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 73712a48e06d jy901.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jy901.lib	Fri Oct 25 09:36:43 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/Cat_Bot/code/jy901/#a93909601341
diff -r 000000000000 -r 73712a48e06d main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Oct 25 09:36:43 2019 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+#include "jy901.h"
+
+JY901 jy(D5, D7); //sda, scl
+Serial pc(USBTX, USBRX);
+
+int main() {
+    float x, y, z;
+    jy.calibrateAll(50);
+    while(1) {
+        x = jy.getXaxisAngle();
+        y = jy.getYaxisAngle();
+        z = jy.getZaxisAngle();
+        pc.printf("x:%f | y:%f | z:%f\r\n", x, y, z);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 73712a48e06d mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Fri Oct 25 09:36:43 2019 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#679d24833acf0a0b5b0d528576bb37c70863bc4e