- 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(
您可能关注的文档
- pep四年级英语unit1-my-classroom第一课时.ppt
- pep小升初六年级下册英语语法现在进行时专项练习.doc
- pep四年级英语上册unit1-my-classroom-story-time.ppt
- pep小学四年级上册英语Unit4知识巩固练习题.doc
- PEP小学英语三年级上册Unit-1-Hello!-Part-B-Start-to-read课件.ppt
- PEP小学英语三年级下册期末试卷-3.doc
- pep小学英语三年级上册Unit3-A-课件.ppt
- PEP小学英语五年级上册单词、重点句型、语法简单归纳(精).doc
- PEP小学英语五年级上册知识点总复习.doc
- PEP小学英语五年级上册重点单词和句子.doc
原创力文档

文档评论(0)