#define GPBCON (*(volatile unsigned *) 0x56000010)
#define GPBDAT (*(volatile unsigned *) 0x56000014)
#define GPBUP (*(volatile unsigned *) 0x56000018)
void delay()
{
int i, j;
for(i = 0; i < 10000; i ++)
for(j = 0; j < 50; j ++);
}
int main()
{
GPBCON = 0x155555;//配置protB的所有引脚为输出
while(1)
{
//点亮第一个小灯
GPBDAT |= 0x1E0;
GPBDAT &= 0x1C0;
delay();
//点亮第二个小灯
GPBDAT |= 0x1E0;
GPBDAT &= 0x1A0;
delay();
//点亮第三个小灯
GPBDAT |= 0x1E0;
GPBDAT &= 0x160;
delay();
//点亮第四个小灯
GPBDAT |= 0x1E0;
GPBDAT &= 0x0E0;
delay();
}
return 0;
}
tq2440跑马灯的工程(MDK)
3星 · 超过75%的资源 需积分: 12 85 浏览量
2011-04-03
20:21:30
上传
评论 1
收藏 55KB RAR 举报
ljw20060802
- 粉丝: 0
- 资源: 10
最新资源
- 基于Python的在线学习与推荐系统设计与实现(论文+源码)-kaic
- 蓝桥杯2024年第十五届省赛真题-前缀总分
- com.qihoo.appstore_300101305-1.apk
- tensorflow-gpu-2.7.1-cp37-cp37m-manylinux2010-x86-64.whl
- tensorflow-2.7.2-cp37-cp37m-manylinux2010-x86-64.whl
- tensorflow-2.7.1-cp39-cp39-manylinux2010-x86-64.whl
- 蓝桥杯2024年第十五届省赛真题-传送阵
- com.qihoo.appstore_300101305.apk
- linux之线程同步一.doc
- keil5配色方案10种
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈