完赛的一个版本
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user