操作說(shuō)明:
1、下行控制報(bào)站:首先按下(下行設(shè)置按鍵),(下行指示燈)亮,然后按下(手動(dòng)播報(bào))按鍵控制播報(bào)下一站
2、上行控制報(bào)站:首先按上(上行設(shè)置按鍵),(上行指示燈)亮,然后按下(手動(dòng)播報(bào))按鍵控制播報(bào)下一站
3、按下關(guān)閉播報(bào)按鍵,則關(guān)閉播報(bào)功能和清除顯示
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
單片機(jī)源程序如下:
- /***************主函數(shù)*****************/
- void main()
- {
- uchar num=0; //定時(shí)器1,工作在定時(shí)方式2
- P0 = P1 = P2 = P3 = 0XFF;
- LcmInit();//初始化12864
- init_12864_dis();
- Send_threelines(0,0); //語(yǔ)音播報(bào)
- while(1)
- {
- key(); //獨(dú)立按鍵程序
- if(key_can < 20)
- {
- if(key_can == 1)
- {
- if(num < geshu)
- {
- num++;
- }
- flag_s = 1;
- }
- if(key_can == 2)
- {
-
- if(num != 0)
- num--;
-
- }
- if(num == 1) //報(bào)第1個(gè)站
- {
- PutStr(1,0,gj_ming);
- PutStr(2,0,table1);
- PutStr(3,0,gj_ming1);
- PutStr(3,0," ");
- Send_threelines(1,0); //語(yǔ)音播報(bào)
-
- }
- if(num == 2) //報(bào)第2個(gè)站
- {
- PutStr(1,0,gj_ming);
- PutStr(2,0,table2);
- PutStr(3,0,gj_ming1);
- PutStr(3,0," ");
- flag_z=1;
- Send_threelines(2,0); //語(yǔ)音播報(bào)
- }
- if(num == 3) //報(bào)第3個(gè)站
- {
- PutStr(1,0,gj_ming);
- PutStr(2,0,table3);
- PutStr(3,0,gj_ming1);
- PutStr(3,0," ");
- Send_threelines(3,0); //語(yǔ)音播報(bào)
- }
- if(num == 4) //報(bào)第4個(gè)站
- {
- PutStr(1,0,gj_ming);
- PutStr(2,0,table4);
- PutStr(3,0,gj_ming1);
- PutStr(3,0," ");
- Send_threelines(4,0); //語(yǔ)音播報(bào)
- }
- if(num == 5) //報(bào)第5個(gè)站
- {
- PutStr(1,0,gj_ming);
- PutStr(2,0,table5);
- PutStr(3,0,gj_ming1);
- PutStr(3,0," ");
- Send_threelines(5,0); //語(yǔ)音播報(bào)
- }
- if(num == 6) //報(bào)第5個(gè)站
- {
- PutStr(1,0,gj_ming);
- PutStr(2,0,table6);
- PutStr(3,0,gj_ming1);
- PutStr(3,0," ");
- Send_threelines(6,0); //語(yǔ)音播報(bào)
- }
- if(num == 7) //報(bào)第5個(gè)站
- {
- PutStr(1,0,gj_ming);
- PutStr(2,0,table7);
- PutStr(3,0,gj_ming1);
- PutStr(3,0," ");
- Send_threelines(7,0); //語(yǔ)音播報(bào)
- }
- if(num == 8) //報(bào)第5個(gè)站
- {
- PutStr(1,0,gj_ming);
- PutStr(2,0,table8);
- PutStr(3,0,gj_ming1);
- PutStr(3,0," ");
- Send_threelines(8,0); //語(yǔ)音播報(bào)
- }
- if(num == 9) //報(bào)第9個(gè)站
- {
- PutStr(1,0,gj_ming);
- PutStr(2,0,table9);
- PutStr(3,0,gj_ming1);
- PutStr(3,0," ");
- if(flag_s == 1)
- {
- Send_threelines(10,0); //語(yǔ)音播報(bào)
- }
- else
- {
- flag_s = 1;
- Send_threelines(9,0); //語(yǔ)音播報(bào)
- }
- }
- }
- }
- }
復(fù)制代碼
全部資料51hei下載地址:
通用的.zip
(45.81 KB, 下載次數(shù): 257)
2019-4-13 09:30 上傳
點(diǎn)擊文件名下載附件
程序
單片機(jī)公交報(bào)站仿真.zip
(179.14 KB, 下載次數(shù): 360)
2019-4-13 09:30 上傳
點(diǎn)擊文件名下載附件
仿真
|