触发阀值单位转换为伏特已完成

This commit is contained in:
zhan-min 2020-12-14 21:08:05 +08:00
parent 232de5734a
commit 80f3ed60f7
5 changed files with 2369 additions and 2195 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -10,7 +10,7 @@
#define MeasurementRange 30
#define MeasurementRange 200
/*
******************************************************************
@ -42,7 +42,7 @@ uint8_t TimePerDivOderNbr = sizeof(TimePerDiv_Group)/sizeof(TimePerDiv_Group[0]
int8_t TimePerDivOder = 0;//当前每格间隔时间的序号
int8_t CurTriggerValue = 0; //代号0触发阀值
int16_t CurTriggerValue = 0; //代号0触发阀值
char* CurRangeMode = {"auto"}; //代号1量程模式0自动1手动
char* CurTriggerMode = {""}; //代号2触发模式0下降沿触发1上升沿触发
char* CurSamplingMode = {"A"}; //代号3采样模式0自动1普通2单次
@ -137,14 +137,16 @@ static void Setting_do(uint8_t CurSetItem, int8_t Operation)
void Setting_Inf_Update(uint8_t CurSetItem)
{
char dispBuff[100];
float ConvertedTriggerValue;//用于将触发阀值单位转换为伏特
ILI9341_Clear(240, 0, 20, 240);
ILI9341_DispString_EN(240, (((sFONT *)LCD_GetFont())->Height)*CurSetItem, "->");
switch(CurSetItem)
{
case 0:
{
ConvertedTriggerValue = CurTriggerValue/200*3.3;
/*使用c标准库把变量转化成字符串*/
sprintf(dispBuff,"TV: %d", CurTriggerValue);
sprintf(dispBuff,"%f V", ConvertedTriggerValue);
ILI9341_DispString_EN(260, (((sFONT *)LCD_GetFont())->Height)*0, dispBuff);
break;
}
@ -166,7 +168,7 @@ void Setting_Inf_Update(uint8_t CurSetItem)
case 4:
{
/*使用c标准库把变量转化成字符串*/
sprintf(dispBuff,"TPD: %d", CurTimePerDiv);
sprintf(dispBuff,"%d ms", CurTimePerDiv);
ILI9341_DispString_EN(260, (((sFONT *)LCD_GetFont())->Height)*4, dispBuff);
break;
}

View File

@ -16,7 +16,7 @@ extern int8_t RangeModeNrb;
extern int8_t TriggerModeNrb;
extern int8_t SamplingModeNrb;
extern int8_t CurTriggerValue; //代号0触发阀值
extern int16_t CurTriggerValue; //代号0触发阀值
extern char* CurRangeMode; //代号1量程模式0自动1手动
extern char* CurTriggerMode; //代号2触发模式0下降沿触发1上升沿触发2上升沿下降沿触发
extern char* CurSamplingMode; //代号3采样模式0自动1普通2单次

View File

@ -170,7 +170,7 @@ void Get_Wave(void* parameter)
while(ADC_SampleCount < ADCx_1_SampleNbr)
{
while(ADC_GetITStatus(ADCx_1, ADC_IT_EOC) != SET);
ADC_ConvertedValue[ADC_SampleCount] = ADC_GetConversionValue(ADCx_1);
ADC_ConvertedValue[ADC_SampleCount] = ADC_GetConversionValue(ADCx_1)*200/255-0.5;//将采样值映射到显示区间
Delay_us( CurTimePerDiv*1000/50 -7 );//采样间隔时间
ADC_ClearITPendingBit(ADCx_1, ADC_IT_EOC);
ADC_SampleCount++;