The current AD value = 0x0FFF The current AD value = 0x0000 The current AD value = 0x0000 The current AD value = 0x0000 The current AD value = 0x0000 The current AD value = 0x0FFF The current AD value = 0x0000 The current AD value = 0x0000 The current AD value = 0x0000 The current AD value = 0x0000 The current AD value = 0x0000 The current AD value = 0x0FFF
融合已经完成,目前只做出一个通道的ADC,用的是有DMA的,ADC2,通道2,转换结果AD_value=ADC_GetConversionValue(ADC2);然后无限发射给另一个NRF,NRF通过转USB虚拟串口发给上位机,上位机也能正常接收到转换结果,但是不知双通道的ADC怎么做,想加个通道1,需要怎么改…… GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOA, &GPIO_InitStructure);
……………………
ADC_InitStructure.ADC_NbrOfChannel = 2;
……………………
ADC_RegularChannelConfig(ADC2, ADC_Channel_1, 1, ADC_SampleTime_55Cycles5);
ADC_RegularChannelConfig(ADC2, ADC_Channel_2, 2, ADC_SampleTime_55Cycles5);
……………………
AD_value=ADC_GetConversionValue(ADC2) 是这样么?
可是这样接收到的数据是这样的
The current AD value = 0x0FFF
The current AD value = 0x0000
The current AD value = 0x0000
The current AD value = 0x0000
The current AD value = 0x0000
The current AD value = 0x0FFF
The current AD value = 0x0000
The current AD value = 0x0000
The current AD value = 0x0000
The current AD value = 0x0000
The current AD value = 0x0000
The current AD value = 0x0FFF
[ 本帖最后由 mahe6562 于 2011-8-15 23:10 编辑 ](我一个脚测5V一个脚测0v)
一周热门 更多>