"); //-->
int main (void) {
int i,j;
stm32_Init (); // STM32 setup
adc_Init();
for(;;){
ADC1->CR2 = (1<<0);
i="ADC1-">DR;
if(i>=0x000004ff)
GPIOB->ODR &= ~LED; // switch on LED
else
GPIOB->ODR |= LED; // switch off LED
//while(USART1->SR&0x40!=0)
while((USART1->SR&0x40)==0);
USART1->DR = i&0xFF;
// Delay(2000000);
while((USART1->SR&0x40)==0);
USART1->DR = (i>>8)&0xff;
for(j=0;j<=10;j++)
{
Delay(2000000);
}
}
}
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。