#include #include #define RR(x) _cror_(x,1); //重新定義 RR右旋函式 #define RL(x) _crol_(x,1); //重新定義 RL左旋函式 void delay(int t); // 宣告延遲函式 void main() { P2 = 0xFE; // 設定P2埠的初始值,P2.0亮 while(1) { delay(250); // 延遲副程式 P2 = RL(P2); // P2埠狀態左旋 } } void delay(int t) // 延遲函數開始 { int i,j; // 宣告整數變數i,j for (i=0;i