野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 18321|回复: 4

初学者指南针开发板LED灯依次闪烁的问题

[复制链接]
发表于 2019-2-13 22:39:17 | 显示全部楼层 |阅读模式
本帖最后由 卓越 于 2019-2-13 22:42 编辑

本来是想要,蓝,红依次闪烁的,但是没有达到效果,请各位懂得指点一下
12.png
562.png
8956.png
回复

使用道具 举报

 楼主| 发表于 2019-2-13 22:51:42 | 显示全部楼层
楼主帮顶!
回复

使用道具 举报

发表于 2019-2-14 16:17:10 | 显示全部楼层
你这是按照51的思维去学的,并没有真正理解要怎么配置寄存器。
我这有三色轮流亮的,你看看
#include "stm32f10x.h"
unsigned long i;
int main(void)
{
                *(unsigned int *)0x40021018 |=(1<<3);
        while(1)
        {
          *(unsigned int *)0x40010C00 |=(1<<(4*0));
          *(unsigned int *)0x40010C0C &=~(1<<0);
                for(i=200000;i>0;i--);
                *(unsigned int *)0x40010C00 &=~(1<<(4*0));
          *(unsigned int *)0x40010C0C |=(1<<0);
                for(i=200000;i>0;i--);
               
                *(unsigned int *)0x40010C00 |=(1<<(4*1));
          *(unsigned int *)0x40010C0C &=~(1<<0);
                for(i=200000;i>0;i--);
                *(unsigned int *)0x40010C00 &=~(1<<(4*1));
          *(unsigned int *)0x40010C0C |=(1<<0);
                for(i=200000;i>0;i--);
               
                *(unsigned int *)0x40010C00 |=(1<<(4*5));
          *(unsigned int *)0x40010C0C &=~(1<<0);
                for(i=200000;i>0;i--);
                *(unsigned int *)0x40010C00 &=~(1<<(4*5));
          *(unsigned int *)0x40010C0C |=(1<<0);
                for(i=200000;i>0;i--);
        }
}
void SystemInit(void)
{
}

回复 支持 反对

使用道具 举报

 楼主| 发表于 2019-2-15 21:11:27 | 显示全部楼层
说不出的感觉 发表于 2019-2-14 16:17
你这是按照51的思维去学的,并没有真正理解要怎么配置寄存器。
我这有三色轮流亮的,你看看
#include "st ...

谢谢                                                   
回复 支持 反对

使用道具 举报

发表于 2019-2-16 10:24:38 | 显示全部楼层
感谢楼主的精彩分享
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2025-12-7 05:02 , Processed in 0.045866 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表