2018.07.26

Dependencies:   TextLCD USBDevice mbed-rtos mbed

Revision:
1:368ba89c2e6b
Parent:
0:f4e2a62331ef
Child:
2:d0a5ee4e7bb8
--- a/2_main.cpp	Tue Feb 16 16:35:14 2016 +0000
+++ b/2_main.cpp	Mon Mar 28 00:09:18 2016 +0000
@@ -228,17 +228,19 @@
     
     send_report.length = 8;
         
-    send_report.data[0] = 0x80; // L JoyStick Right/Left
+    send_report.data[0] = 0x80; // L JoyStick Left/Right
     send_report.data[1] = 0x80; // L JoyStick Up/Down
-    send_report.data[2] = 0x80; // R JoyStick Right/Left
+    send_report.data[2] = 0x80; // R JoyStick Left/Right^
     send_report.data[3] = 0x80; // R JoyStick Up/Down
     send_report.data[4] = 0x00; // Operatiuon Switch
+    // Data Bytes
     //  7 6 5 4   3    2    1    0
-    // +-+-+-+-+----+----+----+----+
-    // |-|-|-|-|LB-I|LB-K|RF-I|RF-K|
-    // +-+-+-+-+----+----+----+----+
+    // +-+-+-+-+-+----+----+----+----+
+    // |-|-|-|-|-|LB-I|LB-K|RF-I|RF-K|
+    // +-+-+-+-+-+----+----+----+----+
         
     send_report.data[5] = 0x00; // JS mode switch 
+    // Command Bit
     //  7 6 5 4 3 2  1   0
     // +-+-+-+-+-+-+---+----+
     // |-|-|-|-|-|-|S/D|I/KO|
@@ -320,7 +322,7 @@
             led4 = 0;
         }
 
-        // Right           
+        // Right
         if( js_rlr_undata > (js_center_value_r_ud + DEAD_ZONE_BAND_WIDTH) ){
             // Crawler Forward Run       
             led4 = 1;
@@ -427,42 +429,42 @@
             send_report.data[4] = 0x01;     // RF Tfm K (Fwd)
             led_ind4 = 1;
             led_ind5 = 1;
-        //    led3 = 0;
+            led_ind6 = 1;
         }
         else if ((sw1 == 1)&&(sw2 == 0)&&(sw3==1)){
             send_report.data[4] = 0x02;     // RF Tfm I (Rvs)
             led3 = 1;
             led_ind4 = 1;
             led_ind5 = 1;
-        //    led3 = 0;
+            led_ind6 = 1;
         }
         else if ((sw1 == 0)&&(sw2 == 0)&&(sw3==1)){  
             send_report.data[4] = 0x04;     // LB Tfm K (Fwd)
             led3 = 1;
             led_ind4 = 1;
             led_ind5 = 1;
-        //    led3 = 0;
+            led_ind6 = 1;
         }
         else if ((sw1 == 1)&&(sw2 == 1)&&(sw3==0)){  
             led3 = 1;
             send_report.data[4] = 0x08;     // LB Tfm I (Rvs)
             led_ind4 = 1;
             led_ind5 = 1;
-        //    led3 = 0;
+            led_ind6 = 1;
         }
         else if ((sw1 == 1)&&(sw2 == 0)&&(sw3==0)){  
             led2 = 1;
             send_report.data[4] = 0x10;     // Winch Down (Fwd)
             led_ind0 = 1;
             led_ind1 = 1;
-        //    led3 = 0;
+            led_ind2 = 1;
         }
         else if ((sw1 == 0)&&(sw2 == 1)&&(sw3==0)){  
             led2 = 1;
             send_report.data[4] = 0x20;     // Winch Up (Rvs) 
             led_ind0 = 1;
             led_ind1 = 1;
-        //    led3 = 0;
+            led_ind2 = 1;
         }
         else{
             send_report.data[4] = 0;
@@ -477,7 +479,7 @@
             led2 = 0;            
             led3 = 0;
         }
-
+        // Command Bit
         //  7 6 5 4 3 2  1   0
         // +-+-+-+-+-+-+---+----+
         // |-|-|-|-|-|-|S/D|I/KO|
@@ -493,6 +495,7 @@
 
         if( sw_jsmode == 1 ){ // sw off 
             send_report.data[5] |= 0x02;    // SW off: Single
+
         }
         else{ // sw off
             send_report.data[5] &= 0xFD;    // SW: on Dual
@@ -504,6 +507,7 @@
         hid.send(&send_report); // send command to USB HID host
         
         Thread::wait(5);
+        //lcd_out( 0, 1, "**********" );    // Handy Only
     }
 
 }
@@ -549,7 +553,7 @@
     lcd_out(0,0,"B2DebrisSurveyor"); 
     lcd_out(0,1,"Revast Co.,Ltd. "); 
     led_demo();
-    lcd_out(0,0,"Rev1.00 20160201"); 
+    lcd_out(0,0,"Rev1.00 20160218"); 
     lcd_out(0,1,"System Booting.."); 
     
     DEBUG_PRINT_L0("\r\n");