Răsfoiți Sursa

add:去掉之前耦合代码

Dozingfiretruck 3 ani în urmă
părinte
comite
e93b5cc6d2
1 a modificat fișierele cu 2 adăugiri și 9 ștergeri
  1. 2 9
      app/port/luat_adc_air101.c

+ 2 - 9
app/port/luat_adc_air101.c

@@ -56,24 +56,17 @@ int luat_adc_read(int ch, int *val, int *val2)
     case 10:
         voltage = adc_temp();
         *val = voltage;
+        *val2 = voltage;
         return 0;
     case 11:
         voltage = adc_get_interVolt();
         *val = voltage;
+        *val2 = voltage;
         return 0;
     default:
         return 1;
     }
     *val2 = voltage;
-    if (*val < 46134) {
-        *val2 = 0;
-    }
-    else if (*val > 123405) {
-        *val2 = 2300;
-    }
-    // else {
-    //     *val2 = (int)((double)(*val - 46134) / (double)(32.196));
-    // }
     return 0;
 }