Presentation is loading. Please wait.

Presentation is loading. Please wait.

點矩陣 通訊一甲 B09622048 楊穎穆. 目錄 1. 摘要 2. 流程圖 3. 程式 4. 實驗結果.

Similar presentations


Presentation on theme: "點矩陣 通訊一甲 B09622048 楊穎穆. 目錄 1. 摘要 2. 流程圖 3. 程式 4. 實驗結果."— Presentation transcript:

1 點矩陣 通訊一甲 B09622048 楊穎穆

2 目錄 1. 摘要 2. 流程圖 3. 程式 4. 實驗結果

3 摘要 ※用 C 語言及 IO Port 來 設計 8x8 點矩陣掃描顯 示電路, 顯示自己的學 號字型每次顯示一秒。

4 流程圖 main int a,b,c,d,e,f,g,h,i,z; delay(x) X-->0 return z=0 z<500 z++ P1=0xff; P0=0x00; P1=scan[ ]; delay(800000); delay(5); P0= B[ ];

5 程式 #include int delay(int); // 宣告副程式 delay int main(void) // 程式開始 { unsigned char code B[]={0x7c,0x7e,0x63,0x7f,0x7f,0x63,0x7e,0x7c}; unsigned char code zero[]={0x7e,0x7e,0x66,0x66,0x66,0x66,0x7e,0x7e}; unsigned char code nine[]={0x7e,0x7e,0x66,0x66,0x7e,0x7e,0x06,0x06}; unsigned char code six[]={0x60,0x60,0x7e,0x7e,0x66,0x66,0x7e,0x7e}; unsigned char code two[]={0x7e,0x7e,0x06,0x7e,0x7e,0x60,0x7e,0x7e}; unsigned char code twoo[]={0x7e,0x7e,0x06,0x7e,0x7e,0x60,0x7e,0x7e}; unsigned char code zeroo[]={0x7e,0x7e,0x66,0x66,0x66,0x66,0x7e,0x7e}; unsigned char code four[]={0x6c,0x6c,0x6c,0x6c,0x7e,0x7e,0x0c,0x0c}; unsigned char code eight[]={0x7e,0x7e,0x66,0x7e,0x7e,0x66,0x7e,0x7e}; unsigned char code scan[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}; while(1) {

6 int a,b,c,d,e,f,g,h,i,z; // 宣告變數 for(z=0;z<500;z++) { for(a=0;a<=7;a++) { P1=0xff; P1=scan[a]; P0=B[a]; delay(5); } P0=0x00; delay(800000); for(z=0;z<500;z++) { for(b=0;b<=7;b++) { P1=0xff; P1=scan[b]; P0=zero[b]; delay(5); }

7 P0=0x00; delay(800000); for(z=0;z<500;z++) { for(c=0;c<=7;c++) { P1=0xff; P1=scan[c]; P0=nine[c]; delay(5); } P0=0x00; delay(800000); for(z=0;z<500;z++) { for(d=0;d<=7;d++) { P1=0xff; P1=scan[d]; P0= six[d]; delay(5); }

8 P0=0x00; delay(800000); for(z=0;z<500;z++) { for(e=0;e<=7;e++) { P1=0xff; P1=scan[e]; P0= two[e]; delay(5); } P0=0x00; delay(800000); for(z=0;z<500;z++) { for(f=0;f<=7;f++) { P1=0xff; P1=scan[f]; P0=twoo[f]; delay(5); }

9 P0=0x00; delay(800000); for(z=0;z<500;z++) { for(g=0;g<=7;g++) { P1=0xff; P1=scan[g]; P0=zeroo[g]; delay(5); } P0=0x00; delay(800000); for(z=0;z<500;z++) { for(h=0;h<=7;h++) { P1=0xff; P1=scan[h]; P0=four[h]; delay(5); }

10 P0=0x00; delay(800000); for(z=0;z<500;z++) { for(i=0;i<=7;i++) { P1=0xff; P1=scan[i]; P0=eight[i]; delay(5); } P0=0x00; delay(800000); } int delay(int x) { while(x>0) x--; return 0; }

11 實驗結果 ※實際測出的結果。實際測出的結果

12 END


Download ppt "點矩陣 通訊一甲 B09622048 楊穎穆. 目錄 1. 摘要 2. 流程圖 3. 程式 4. 實驗結果."

Similar presentations


Ads by Google