打印

新手编写LED程序

[复制链接]
398|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
小小的人呀|  楼主 | 2020-4-20 09:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
感觉程序没问题,可能是LED灯冲突了,导致颜色不对,绿色加蓝色=青色,然后加上红色就一直是青紫色闪啊闪...

这种问题如何解决?求各位大神指点。

int main(void)
{
while(1)
{
* (unsigned int *)0x40021018  |= ((1)<<3);
* (unsigned int *)0x40010C00  |= ((1)<<(4*0));
* (unsigned int *)0x40010C0C  &= ~(1<<0);
DelayMS()        ;
* (unsigned int *)0x40021018  |= ((1)<<3);
* (unsigned int *)0x40010C00  |= ((1)<<(4*0));
* (unsigned int *)0x40010C0C  |= (1<<0);
DelayMS()        ;
* (unsigned int *)0x40021018  |= ((1)<<3);
* (unsigned int *)0x40010C00  |= ((1)<<(4*1));
* (unsigned int *)0x40010C0C  &= ~(1<<0);
DelayMS()        ;
* (unsigned int *)0x40021018  |= ((1)<<3);
* (unsigned int *)0x40010C00  |= ((1)<<(4*1));
* (unsigned int *)0x40010C0C  |= (1<<0);
DelayMS()        ;
* (unsigned int *)0x40021018  |= ((1)<<3);
* (unsigned int *)0x40010C00  |= ((1)<<(4*5));
* (unsigned int *)0x40010C0C  &= ~(1<<0);
DelayMS()        ;
* (unsigned int *)0x40021018  |= ((1)<<3);
* (unsigned int *)0x40010C00  |= ((1)<<(4*5));
* (unsigned int *)0x40010C0C  |= (1<<0);
DelayMS()        ;
}
}

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

399

主题

399

帖子

0

粉丝