Blue LDM test for CP4

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
kstokely
Date:
Tue Aug 25 17:56:25 2020 +0000
Parent:
2:a29fc54a61cb
Commit message:
Update for Blue LDM Control;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a29fc54a61cb -r 5e0d2bf44533 main.cpp
--- a/main.cpp	Mon Aug 24 14:17:58 2020 +0000
+++ b/main.cpp	Tue Aug 25 17:56:25 2020 +0000
@@ -6,10 +6,11 @@
 string pcstr;
 
 
-device.baud(38400);//Default for blue LDM
-pc.baud(9600);
+
 int main() 
 {
+    device.baud(38400);//Default for blue LDM
+    pc.baud(9600);
     pc.printf("Mbed Test of CP4 LDM \n\r");
     
     while(1) 
@@ -26,38 +27,54 @@
         {
             pc.scanf("%s", pcstr.c_str() );
             char c = pcstr.c_str()[0];
-            
+            pc.printf("Mbed Command Received: %c\n\r",c);
             //List of LDM Commands
    
             //Take Single Measurement
             if( c == '[' )
             {
-                pc.printf("iSM");
+                pc.printf("iSM\n\r");
+                device.printf("iSM\n\r");
+            }
+            if (c == 'm')
+            {
+                pc.printf("iSET:5,1\n\r");
+                device.printf("iSET:5,1\n\r");
+            }
+            if (c == 'n')
+            {
+                pc.printf("iSET:5,0\n\r");
+                device.printf("iSET:5,0\n\r");
             }
             //Continuous Measurement
             if( c == 'c' )
             {
-                pc.printf("iACM");
+                pc.printf("iACM\n\r");
+                device.printf("iACM\n\r");
             }
             //Fast Continuous Measurement
             if( c == 'C' )
             {
-                pc.printf("iFACM");
+                pc.printf("iFACM\n\r");
+                device.printf("iFACM\n\r");
             }
             //Stop Measurement
             if ( c == 's' )
             {
-                pc.printf("iHALT");
+                pc.printf("iHALT\n\r");
+                device.printf("iHALT\n\r");
             }
             //Laser Pointer On
             if( c == ',' )
             {
-                pc.printf("iLD:1");
+                pc.printf("iLD:1\n\r");
+                device.printf("iLD:1\n\r");
             }
             //Laser Pointer Off
             if( c == '.' )
             {
-                pc.printf("iLD:0");
+                pc.printf("iLD:0\n\r");
+                device.printf("iLD:0\n\r");
             }
         }