按键输入
1、程序:
#include "Config.h"
#define led 1<<23
#define key 1<<14
void Delay(uint32 dly)
{ uint32 i;
for ( ; dly>0; dly--)
for (i=0; i<50000; i++);
}
int main()
{
PINSEL0=0x00000000;
IO0DIR=led;
while(1)
{
if((IO0PIN&key)==0){IO0CLR=led;}
else IO0SET=led;
Delay(10);
}
}
2、仿真电路图: