#if 0
#endif
#include "stm32f10x.h"
int main(void){
*(unsigned int*)(0x40021018)|=((1)<<3);
// //通过端口配置寄存器配置IO为输出 PB0
// *(unsigned int*)(0x40010C00) |=((1)<<(4*0));
// //通过端口配置寄存器配置IO为输出 PB1
// *(unsigned int*)(0x40010C00) |=((1)<<(4*1));
//通过端口配置寄存器配置IO为输出 PB5
*(unsigned int*)(0x40010C00) |=((1)<<(4*5));
//控制ODR寄存器
// while(1){
// *(unsigned int*)(0x40010C0C) &=~(1<<0);
// }
// *(unsigned int*)(0x40010C0C) &=~(1<<0);
while (1){
int i=0;
*(unsigned int*)(0x40010C0C) &=~(1<<5); //点亮小灯
for (i=0; i<30000; i++); //延时一段时间
*(unsigned int*)(0x40010C0C) |=(1<<5); //熄灭小灯
for (i=0; i<30000; i++); //延时一段时间
}
//return 0;
}
//1.点亮其他两个LED灯
//2.写一个简单的延时函数,让灯闪烁
void SystemInit(void){
//函数体为空,目的是推进不报错
}
野火 STM32 F103 指南者LED灯闪烁作业
最新推荐文章于 2024-01-20 20:43:03 发布