s

Dependencies:   mbed mbed

Files at this revision

API Documentation at this revision

Comitter:
TUATBM
Date:
Tue Aug 28 09:31:55 2018 +0000
Commit message:
s

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
mbed.lib 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	Tue Aug 28 09:31:55 2018 +0000
@@ -0,0 +1,74 @@
+#include "mbed.h"
+#include "Serial.h"
+
+/*送信*/
+/*
+Serial usbSerial(PA_9, PA_10);
+ 
+void ISR_Serial_Rx()
+{
+    // シリアルの受信処理
+    char data = usbSerial.getc();
+}
+ 
+void ISR_Serial_Tx()
+{
+    // シリアルのs送信処理
+    usbSerial.attach(NULL, Serial::TxIrq);
+}
+ 
+int main()
+{
+    // シリアル通信の速度設定
+    usbSerial.baud(9600);
+ 
+    // シリアル通信受信の割り込みイベント登録
+    usbSerial.attach(ISR_Serial_Rx, Serial::RxIrq);
+ 
+    // シリアル通信のデータ送信
+    usbSerial.attach(ISR_Serial_Tx, Serial::TxIrq);
+
+    
+ 
+    while (1) {
+        // メイン処理
+        usbSerial.putc('2');
+        wait(3.0);
+        printf("a\r\n");
+    }
+}
+*/
+
+
+/*受信*/
+
+Serial usbSerial(PA_9,PA_10);
+Serial MySerial1(USBTX,USBRX);
+ 
+void ISR_Serial_Rx()
+{
+    // シリアルの受信処理
+    char data = usbSerial.getc();
+    
+    printf("%c",data);
+    printf("Hello world!\r\n");
+    
+    
+}
+ 
+int main()
+{
+    // シリアル通信の速度設定
+    usbSerial.baud(9600);
+ 
+    // シリアル通信受信の割り込みイベント登録
+    usbSerial.attach(ISR_Serial_Rx, Serial::RxIrq);
+ 
+    while (1) { 
+        // メイン処理
+        printf("NOKOLAT\r\n");
+        wait(1.0);
+ 
+        }
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Aug 28 09:31:55 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.lib	Tue Aug 28 09:31:55 2018 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/screamer/code/mbed/#aff670d0d510