LORA_RA_L475VG

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
peng103617
Date:
Thu Aug 06 06:45:21 2020 +0000
Commit message:
LORA_RA_L475VG

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	Thu Aug 06 06:45:21 2020 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+#include <string>
+
+Serial pc(USBTX, USBRX);
+Serial uart(PA_0, PA_1);//TX4,RX4
+int idx=0;
+string inputdata;
+
+void newData()
+{
+char ch;
+while (uart.readable()) {
+ch = uart.getc();
+if (ch == 's') {
+inputdata.clear();
+}
+inputdata += ch;
+if (ch == '#') {
+inputdata.erase(0,1);
+inputdata.erase(inputdata.length()-1,1);
+pc.printf("%s\n\r",inputdata);
+wait(0.01);
+}
+//pc.printf("wwwwwww");
+
+}
+}
+
+int main()
+{
+
+uart.baud(9600);
+uart.attach(&newData);
+while(1) {
+    
+    
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Aug 06 06:45:21 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file