ÐÂÊÖÈëÃÅ
- »ý·Ö
- 7
- ½ðÇ®
- 7
- ×¢²áʱ¼ä
- 2020-6-26
- ÔÚÏßʱ¼ä
- 2 Сʱ
|
ֹͣģʽµÄµÍ¹¦ºÄÓ¦¸ÃÊÇua¼¶µÄ£¬µ«ÊÇÎÒµÄÊÇMA¼¶µÄ£¬À§»óÁ˺ܾã¬ËÄܰïæ¿´¿´£¿°å×ÓÊǺËÐİ壬LED£¬ASM1117,¾§Õñ£¬ÄܲðµÄ¶¼²ðÁË£¬´úÂëÒ²ÊÇÄÜÈ¥µÄ¶¼È¥ÁË£¬¿É»¹ÊDz»ÐÐ
int main(void)
{
u16 i,j;
GPIO_InitTypeDef GPIO_InitStructure;
for(i=0;i<1000;i++)
for(j=0;j<10000;j++);//ÑÓ³Ù£¬ÎªÁ˺ÃÏÂÔØ³ÌÐò
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOF, ENABLE);
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; //PA0~PA14
GPIO_Init(GPIOA,&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1;//PF0~PF1
GPIO_Init(GPIOF,&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;//PB1
GPIO_Init(GPIOB,&GPIO_InitStructure);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); //¿ªµçÔ´¹ÜÀíʱÖÓ
ADC_Cmd(ADC1,DISABLE);
PWR_EnterSTOPMode(PWR_Regulator_LowPower,PWR_SLEEPEntry_WFI);
while(1)£»
}
|
|