20 lines
285 B
C
20 lines
285 B
C
/*
|
||
自定义的数学运算。
|
||
*/
|
||
|
||
#pragma once
|
||
|
||
|
||
#include <math.h>
|
||
#include <stdint.h>
|
||
|
||
#ifndef M_PI
|
||
#define M_PI 3.14159265358979323846f
|
||
#endif
|
||
|
||
/**
|
||
* @brief 用于计算ADC数据对应的距离(mm)
|
||
* @param adc_data
|
||
* @return
|
||
*/
|
||
float Adc_to_Distance(uint16_t adc_data); |