stm32开发板流水灯程序.docxVIP

  • 4
  • 0
  • 约1.08千字
  • 约 2页
  • 2019-10-05 发布于浙江
  • 举报
以下是main.C 在keil中新建工程,添加相应的库文件,如gpio.c,lib.c等,再编辑这个文件添加到工程中去,编译,下载运行就可以让板子上PB口12,13,14,15引脚对应的LED跑起来了。 #include stm32f10x_lib.h GPIO_InitTypeDef GPIO_InitStructure; void LED_Init(void) { RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, GPIO_InitStructure); } void LED_TurnOn(u8 led) { } void Delay(vu32 nCount) { for(; nCount != 0; nCount--); } main() { //RCC_Configuration(

文档评论(0)

1亿VIP精品文档

相关文档