完赛的一个版本

This commit is contained in:
2024-06-27 02:28:12 +08:00
parent f04b21f738
commit fad2a71e3a
6 changed files with 55 additions and 28 deletions

View File

@@ -1 +1,13 @@
#include "jj_voltage.h"
#include "zf_driver_adc.h"
#define GET_VOL_PIN ADC2_IN5_A5
float now_vol;
void vol_init(void)
{
adc_init(GET_VOL_PIN,ADC_12BIT);
}
void get_vol()
{
now_vol=0.003377f*adc_convert(GET_VOL_PIN)+0.16f;
}