This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#include "SWM221.h"
int main(void)
{
SystemInit();
GPIO_Init(GPIOA, PIN2, 0, 1, 0, 0); //输入,上拉使能,接KEY
GPIO_Init(GPIOA, PIN5, 1, 0, 0, 0); //输出, 接LED
while(1==1)
if(GPIO_GetBit(GPIOA, PIN2) == 0) //按键被按下
GPIO_SetBit(GPIOA, PIN5);
}
else
GPIO_ClrBit(GPIOA, PIN5);