yuya koyama / Mbed 2 deprecated projectKoyama

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
chibait
Date:
Fri Jun 26 02:13:17 2020 +0000
Commit message:
koyama

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jun 26 02:13:17 2020 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+Serial pc(USBTX, USBRX);
+Serial rn42(p13,p14);//TXがP0_13 RXがP0_14で宣言
+//Pin setting for Analog input
+AnalogIn a(p15);
+AnalogIn b(p16);
+AnalogIn c(p17);
+
+int main() {
+    //pc.printf("test\r\n");
+    pc.baud(9600);
+    rn42.baud(9600);
+    myled = 1;
+    wait(0.2);
+    myled = 0;
+    //rn42.printf("test\r\n");
+    
+    time_t seconds = time(NULL) + (60 * 60 * 9); // JST
+    struct tm *t = localtime(&seconds);
+    char buffer[32];
+                  
+    while(1) {
+        //pc.printf("voltage: %4.5f\r\n", a.read());
+        //seconds = time(NULL) + (60 * 60 * 9); // JST
+        //strftime(buffer, 16, "%H:%M:%S", localtime(&seconds));
+        //rn42.printf("%s,", buffer); 
+        rn42.printf("%s,%4.7f,%4.7f,%4.7f", buffer,a.read(),b.read(),c.read());
+        //pc.printf("%s,", buffer); 
+        //pc.printf("%4.7f,%4.7f,%4.7f\r\n", a.read(),b.read(),c.read());
+        //wait(0.5);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jun 26 02:13:17 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file