新闻中心

EEPW首页>嵌入式系统>设计应用> ARM的第一个程序(基于LPC2134)

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;
}
附图:


关键词:ARMLPC213

评论


技术专区

关闭