#include #define LED P2 void delay(int t); unsigned char code led_data[16]={0xf3,0xf7,0xf3,0xf7,0xf3,0xf7,0xf3,0xf5, 0xde,0xfe,0xde,0xfe,0xde,0xfe,0xde,0xee}; //在程式記憶體儲存要顯示的資料 unsigned int code delay_time[16]={250,10,10,10,10,10,10,40,250,10,10,10,10,10,10,40}; //在程式記憶體儲存要顯示的時間 unsigned int i; void main(void) { while(1) { for(i=0; i<16; i++) { LED = led_data[i]; //依序將資料顯示於LED delay(delay_time[i]); //控制每次延遲的時間 } } } void delay(int t) // 延遲函數開始 { unsigned int i,j; // 宣告整數變數i,j for (i=0;i