参考: 定番!ARMキット&PIC用Cプログラムでいきなりマイコン制御[DVD-ROM付き] (マイコン活用シリーズ), p.59
main.c
#include "mcc_generated_files/mcc.h" #define LED0 RB2 #define LED1 RB3 #define LED2 RB4 #define PUSH_SW0 RA3 #define PUSH_SW1 RB7 #define PUSH_SW2 RE3 #define LED_ON 1 #define LED_OFF 0 void main(void) { SYSTEM_Initialize(); while (1) { if( PUSH_SW0) {LED0 = LED_OFF;} if(!PUSH_SW0) {LED0 = LED_ON ;} if( PUSH_SW1) {LED1 = LED_OFF;} if(!PUSH_SW1) {LED1 = LED_ON ;} if( PUSH_SW2) {LED2 = LED_OFF;} if(!PUSH_SW2) {LED2 = LED_ON ;} } }