原内容为:
// LPC824 Max board#elif TARGET_BOARD == 824
#define RED (1<<12)
#define BLUE (1<<27)
#define GREEN (1<<16)
#define red_led_port P0_12
#define blue_led_port P0_27
#define green_led_port P0_16
#define TARGET_TX P0_7 // For the MBED serial port
#define TARGET_RX P0_18 // For the MBED serial port
#define NUM_IOCON_P0_SLOTS 31 // For looping through the pad controls
修改为:
// LPC824 Max board
#elif TARGET_BOARD == 824
#define RED (1<<15)
#define BLUE (1<<17)
#define GREEN (1<<16)
#define red_led_port P0_15
#define blue_led_port P0_17
#define green_led_port P0_16
#define TARGET_TX P0_4 // For the MBED serial port
#define TARGET_RX P0_0 // For the MBED serial port
#define NUM_IOCON_P0_SLOTS 31 // For looping through the pad controls
接下来需要修改主文件“Example_GPIO_PatternMatch.c”。
第54行可看到有一句, Config_LEDs(RED | BLUE | GREEN);
说明程序中已经配置了三个LED灯,我们不需要再对LED初始化。