ARM的第一个程序(基于LPC2134) 作者: 时间:2016-11-20 来源:网络 加入技术交流群 扫码加入和技术大咖面对面交流海量资料库查询 收藏 #include "config.h"//流水灯数值表int Led_Table[]={ 0x00fe0000,0x00fd0000,0x00fb0000,0x00f70000,0x00ef0000, 0x00df0000,0x00bf0000,0x007f0000}; //主函数int main(){ int i=0; PINSEL1=0x00000000; IO1DIR=0xff<<16; //这个写法很清楚,推荐 while(1) { IO1SET=Led_Table[i];//设置高电平引脚 IO1CLR=~Led_Table[i]; //设置低电平引脚 delay(60); i++; if(i==8) { i=0; } } return 0;}附图:
评论