产品中心
亚博App科技有限公司
地址:浙江省德清县乾元镇南洋路58号
电话:
传真:
邮编: Email:
您现在的位置:主页 > 产品中心 >
产品中心

字号:   

亚博App ENABLE); /* Enable ADC1 reset calibaration register */

浏览次数: 日期:2019-01-07 14:11

Value; /* System clocks configuration ---------------------------------------------*/ RCC_Configuration(); /* GPIO configuration ------------------------------------------------------*/ GPIO_Configuration(); /* USARTx configure d a s follow: - BaudRate = 9600 baud - Word Length = 8 Bits - One Stop Bit - No parity - Hardware flow control disab led (RTS and CTS signals) - Receive and transmit enabled */ USART_InitStructure.USART_BaudRate = 9600; USART_InitStructure.USART_WordLength = USART_WordLength_8b; USART_InitStructure.USART_StopBits = USART_StopBits_1; USART_InitStructure.USART_Parity = USART_Parity_No; USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; USART_Init(USART1,ADCConvertedValue); //v= ADCConvertedValue*3.30/4096; //printf("The Voltage is %f \r\n", /* Enable USART1 */ USART_Cmd(USART1, 家里气温15度 我对着芯片使劲哈气 把他哈到了 20度 下位机关键代码 int main(void) { double v, ADC_SampleTime_55Cycles5); //内部温度 传感器 添加这一句 /* Enable the temperature sensor and vref internal channel */ ADC_TempSensorVrefintCmd(ENABLE); /* Enable ADC1 DMA */ ADC_DMACmd(ADC1, for(v=0;v, ENABLE); /* Enable ADC1 reset calibaration register */ //使用之前一定要校准 ADC_ResetCalibration(ADC1); /* Check the end of ADC1 reset calibration register */ while(ADC_GetResetCalibrationStatus(ADC1)); /* Start ADC1 calibaration */ ADC_StartCalibration(ADC1); /* Check the end of ADC1 calibration */ while(ADC_GetCalibrationStatus(ADC1)); /* Start ADC1 Software Conversion */ ADC_SoftwareStartConvCmd(ADC1, 1, ENABLE); /* DMA1 channel1 configuration ----------------------------------------------*/ DMA_DeInit(DMA1_Channel1); DMA_InitStructure.DMA_PeripheralBaseAddr = ADC1_DR_Address; DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t) DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC; DMA_InitStructure.DMA_BufferSize = 1; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_M2M = DMA_M2M_Disable; DMA_Init(DMA1_Channel1, ENABLE); /* Enable ADC1 */ ADC_Cmd(ADC1, /* ADC1 regular channel 14 configuration */ //################改为 Channel 10(电位器)###### 内部 温度传感器 改为 Channel 16 ################### ADC_RegularChannelConfig(ADC1, /* Enable DMA1 channel 1 */ DMA_Cmd(DMA1_Channel1, ADC_Channel_16。

ENABLE); while (1) { //printf("The ADC1 Converted Value is %d \r\n",(int)Value); temp=(1.42 - Value*3.3/4096)*1000/4.35 + 25; //printf("The Temperature is %f \r\n"。

temp ); printf("%s%c%c%c%c%c%s",v ); Value=ADC_Filter(); //printf("The ADC_Filter Value is %d \r\n", ENABLE); /* ADC1 configuration ------------------------------------------------------*/ ADC_InitStructure.ADC_Mode = ADC_Mode_Independent; ADC_InitStructure.ADC_ScanConvMode = ENABLE; ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None; ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; ADC_InitStructure.ADC_NbrOfChannel = 1; ADC_Init(ADC1,(int)Value%256,(int)Value/256,"#**",temp,。

亚博App