新手入门
- 积分
- 6
- 金钱
- 6
- 注册时间
- 2022-1-15
- 在线时间
- 1 小时
|
#include "stm32f10x.h"
void Delay(int count)//延时函数
{
for(count=0;count!=0;count--);
}
int main(void)
{
//1.打开GPIOB的时钟
*(unsigned int * )0X40021018 |= ((1)<<3);
//2.配置IO口为输出模式
*(unsigned int * )0X40010C00 &= ~((0x0f)<<(4*0));
*(unsigned int * )0X40010C00 |= ((1)<<(4*0)); //PB0的地址
while(1)
{
//3.控制ODR寄存器
*(unsigned int * )0X40010C0C &= ~(1<<0); 为什么这段程序不执行,不能清零
Delay(1000);
*(unsigned int * )0X40010C0C |= (1<<0); 为什么这段程序不执行,不能置1
Delay(1000);
|
|