LPC824専用プログラム

Dependencies:   Ping SDFileSystem mbed-src

Revision:
11:a5023f22f25a
Parent:
10:641da47d4a14
Child:
12:c90a124169e6
--- a/format.cpp	Sun Jan 24 17:23:15 2016 +0000
+++ b/format.cpp	Tue Jan 26 15:03:56 2016 +0000
@@ -97,6 +97,7 @@
     else{
         //pc.printf("FFFF\r\n");
     }
+    wait_us(100);
     led[1]=0;
 }
 void Usw_System(void){
@@ -122,7 +123,7 @@
         rear_dis = rear.Read_cm();
         if(rear_dis>0xFE) rear_dis=0xFE;
         led[0]=0;
-        
+        wait_us(100);
         pc.printf("%d\t%d\t\r\n", front_dis, rear_dis);
         
         //emergency();
@@ -185,9 +186,9 @@
     
     uint8_t i;//ic
     uint8_t j;//ch
-    uint8_t num_long, num_short;
-    uint16_t ir_val, ir_val_long[8], ir_val_short[12];
-    uint8_t ir_posi, ir_posi_long[8], ir_posi_short[12];
+    //uint8_t num_long, num_short;
+    //uint16_t ir_val, ir_val_long[8], ir_val_short[12];
+    //uint8_t ir_posi, ir_posi_long[8], ir_posi_short[12];
     static uint8_t const ch_num[3]={8, 8, 4};
 
     uint16_t ir_data[IC_NUM][IR_NUM]={0};
@@ -199,6 +200,7 @@
     ir.format(8, 3);
     ir.frequency(1000000);
     
+    //遠距離用電源
     supply.period(0.010);//T=10[ms]
     supply.write(0.9);//L...10%,H...90%
     
@@ -207,8 +209,8 @@
     for(i=0; i<IC_NUM; i++) cs[i]=1;
     while(1) {
         
-        num_short=0;
-        num_long=0;
+        //num_short=0;
+        //num_long=0;
         for(i=0; i<IC_NUM; i++){//IC
             for(j=0; j<ch_num[i]; j++){//Ch
                 ir_data[i][j] = read_input(i, j);
@@ -231,11 +233,11 @@
         
         //BubbleSort(ir_val_short, ir_posi_short, 12);
         //BubbleSort(ir_val_long, ir_posi_long, 8);
-        
+        /*
         ir_position[0] = ir_posi_short[0];
         ir_position[1] = ir_posi_long[0];
         ir_notice=0;
-        
+        */
         pc.printf("%Value is ");
         pc.printf("%d\t", ir_data[1][0]);
         pc.printf("%d\t", ir_data[1][1]);