@@ -15,8 +15,8 @@ extern "C" {
#define COUNT_BASE (4096)
-#define ALL_RES (501000)
-#define GATHER_RES (1000)
+#define ALL_RES (505000)
+#define GATHER_RES (5000)
#include "stm32f0xx_hal.h"
@@ -64,8 +64,10 @@ static void get_adc_val()
temp *= ALL_RES;
temp /= GATHER_RES;
temp /= 10.0;
- if(temp > 50)
- temp+=(500);
+// if(temp > 50)
+// temp+=(500);
+ if(temp < 500)
+ temp = 0;
tx_voltage.f_data = temp;
}