📄 ledblinkymain.c
字号:
#include <LPC23xx.H> /* LPC23xx definitions */
#define LED_A 0x01
#define LED_B 0x02
#define LED_C 0x04
#define LED_D 0x08
#define LED_E 0x10
#define LED_F 0x20
#define LED_G 0x40
#define LED_H 0x80
int main (void)
{
void delay();
FIO2DIR = 0x000000FF; /* P2.0..7 defined as Outputs */
FIO2MASK = 0x00000000;
FIO2PIN = 0x00000000;
PINSEL10 = 0;
for(;;)
{
FIO2SET = LED_A;
delay();
FIO2CLR = LED_A;
delay();
FIO2SET = LED_B;
delay();
FIO2CLR = LED_B;
delay();
FIO2SET = LED_C;
delay();
FIO2CLR = LED_C;
delay();
FIO2SET = LED_D;
delay();
FIO2CLR = LED_D;
delay();
FIO2SET = LED_E;
delay();
FIO2CLR = LED_E;
delay();
FIO2SET = LED_F;
delay();
FIO2CLR = LED_F;
delay();
FIO2SET = LED_G;
delay();
FIO2CLR = LED_G;
delay();
FIO2SET = LED_H;
delay();
FIO2CLR = LED_H;
delay();
}
}
void delay()
{
int i;
for(i=0;i<1000000;i++);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -