Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: serial_arduino 300_PS3Dribbler 300_PS3com Quadrifoglio_PS3COM
Revision 2:3b34130dfdd2, committed 2022-06-17
- Comitter:
- piroro4560
- Date:
- Fri Jun 17 06:24:01 2022 +0000
- Parent:
- 1:36350a60662e
- Commit message:
- adjust thread
Changed in this revision
| SerialArduino.cpp | Show annotated file Show diff for this revision Revisions of this file | 
--- a/SerialArduino.cpp	Fri Jun 17 06:05:57 2022 +0000
+++ b/SerialArduino.cpp	Fri Jun 17 06:24:01 2022 +0000
@@ -10,29 +10,31 @@
 
 void SerialArduino::serialLoop()
 {
-    mini.read(&hedder1,1);
-    mini.read(&hedder2,1);
-//    mini.read(buff,1);
-//    checkSum = atoi(&buff[2]);
-    if(hedder1==0xff 
-    && hedder2==0xee 
-    )
-    {
-//        mini.read(&button,2);
-        mini.read(&b0,1);
-        mini.read(&b1,1);
-        mini.read(&trigger[0],1);
-        mini.read(&trigger[1],1);
-        mini.read(&stick[0],1);
-        mini.read(&stick[1],1);
-        mini.read(&stick[2],1);
-        mini.read(&stick[3],1);
-//        mini.read(&checkSum,1);
-        mini.read(&timeout,1);
-
+    while (1) {
+        mini.read(&hedder1,1);
+        mini.read(&hedder2,1);
+    //    mini.read(buff,1);
+    //    checkSum = atoi(&buff[2]);
+        if(hedder1==0xff 
+        && hedder2==0xee 
+        )
+        {
+    //        mini.read(&button,2);
+            mini.read(&b0,1);
+            mini.read(&b1,1);
+            mini.read(&trigger[0],1);
+            mini.read(&trigger[1],1);
+            mini.read(&stick[0],1);
+            mini.read(&stick[1],1);
+            mini.read(&stick[2],1);
+            mini.read(&stick[3],1);
+    //        mini.read(&checkSum,1);
+            mini.read(&timeout,1);
+    
+        }
+//        mini.write(CRLF,2);
+//        ThisThread::sleep_for(1);
     }
-    mini.write(CRLF,2);
-    ThisThread::sleep_for(1);
 
 }