割り込みバージョンのサンプル

Dependencies:   R1370

Files at this revision

API Documentation at this revision

Comitter:
UCHITAKE
Date:
Fri Aug 24 04:38:58 2018 +0000
Commit message:
initial commit

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
R1370.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Fri Aug 24 04:38:58 2018 +0000
@@ -0,0 +1,4 @@
+.build
+.mbed
+projectfiles
+*.py*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/R1370.lib	Fri Aug 24 04:38:58 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/NHK-Robocon2016_Nagaoka_B_Team/code/R1370/#243364135087
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Aug 24 04:38:58 2018 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+#include "R1370.h"
+
+R1370 r1370(PC_10, PC_11);
+Serial pc(USBTX, USBRX, 230400);
+DigitalOut led1(LED1);
+
+// main() runs in its own thread in the OS
+int main() {
+    while (true) {
+        led1 = !led1;
+        pc.printf("ANGLE:<%3.4fdegrees>", r1370.getAngle());
+        pc.printf("  RATE:<%3.4fdegrees>", r1370.getRate());
+        pc.printf("  ACC:<%4d, %4d, %4d>\r\n", r1370.getAcc('x'), r1370.getAcc('y'), r1370.getAcc('z'));
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Fri Aug 24 04:38:58 2018 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#f8b140f8d7cb226e41486c5df66ac4f3ce699219