12 lines
255 B
C
12 lines
255 B
C
/*
|
|
自定义的数学运算。
|
|
*/
|
|
|
|
#include "user_math.h"
|
|
#include <stdint.h>
|
|
|
|
|
|
float Adc_to_Distance(uint16_t adc_data) {
|
|
// return (float)((adc_data * 1000) / 4095);
|
|
return (float)((adc_data * 1000) / 4095.0f); // 使用浮点数进行计算
|
|
} |