?? [轉貼]實用電子秤5-5.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0039)http://218.106.165.186/Facture/418.html -->
<HTML><HEAD><TITLE>[轉貼]實用電子秤5/5</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
href="[轉貼]實用電子秤5-5.files/main.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY leftMargin=0 topMargin=0 onload="javascript:window.status='歡迎訪問---華方卓越'">
<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width=800 border=0>
<TBODY>
<TR>
<TD align=middle bgColor=#0066cc height=8>
<SCRIPT src="[轉貼]實用電子秤5-5.files/mystat.htm"></SCRIPT>
</TD></TR></TBODY></TABLE>
<TABLE borderColor=#c4d5fd width=800 bgColor=#c4d5fd border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width=790 align=center bgColor=#ffffff
border=0>
<TBODY>
<TR>
<TD align=middle width=160 bgColor=#ffffff height=80>
<P><IMG src="[轉貼]實用電子秤5-5.files/glorywork.gif"></P></TD>
<TD align=middle height=74>幸福生活每一天!</TD>
<TD align=middle width=70 height=80>
<TABLE cellSpacing=0 cellPadding=0 width="95%" border=0>
<TBODY>
<TR>
<TD align=middle height=25><A
onclick="javascript:window.external.addFavorite('http://www.glorywork.com','華 方 卓 越')"
href="http://218.106.165.186/Facture/418.html#">加入收藏</A></TD></TR>
<TR>
<TD align=middle height=25><A style="CURSOR: hand"
onclick='this.style.behavior="url(#default#homepage)";this.sethomepage("http://www.glorywork.com")'
href="http://218.106.165.186/Facture/418.html#">設為主頁</A></TD></TR>
<TR>
<TD align=middle height=25><A
href="http://218.106.165.186/">返回首頁</A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=1 cellPadding=3 width=800 bgColor=#c4d5fd border=0>
<TBODY>
<TR vAlign=center bgColor=#0066cc>
<TD onmouseover="javascript:this.bgColor='#ff6600';"
onmouseout="javascript:this.bgColor='#0066CC';" align=middle><A
href="http://218.106.165.186/Sutra/index/index.asp"><FONT
color=white>經典文章</FONT></A></TD>
<TD onmouseover="javascript:this.bgColor='#ff6600';"
onmouseout="javascript:this.bgColor='#0066CC';" align=middle><A
href="http://218.106.165.186/Program/index/index.asp"><FONT
color=white>程序參考</FONT></A></TD>
<TD onmouseover="javascript:this.bgColor='#ff6600';"
onmouseout="javascript:this.bgColor='#0066CC';" align=middle><A
href="http://218.106.165.186/Circuit/index/index.asp"><FONT
color=white>電路收藏</FONT></A></TD>
<TD onmouseover="javascript:this.bgColor='#ff6600';"
onmouseout="javascript:this.bgColor='#0066CC';" align=middle><A
href="http://218.106.165.186/Facture/index/index.asp"><FONT
color=white>應用制作</FONT></A></TD>
<TD onmouseover="javascript:this.bgColor='#ff6600';"
onmouseout="javascript:this.bgColor='#0066CC';" align=middle><FONT
color=white>項目聯盟</FONT></A></TD>
<TD onmouseover="javascript:this.bgColor='#ff6600';"
onmouseout="javascript:this.bgColor='#0066CC';" align=middle><A
href="http://218.106.165.186/OutPut/index/index.asp"><FONT
color=white>產品展示</FONT></A></TD>
<TD onmouseover="javascript:this.bgColor='#ff6600';"
onmouseout="javascript:this.bgColor='#0066CC';" align=middle><A
href="http://218.106.165.186/Download/index/index.asp"><FONT
color=white>資料下載</FONT></A></TD>
<TD onmouseover="javascript:this.bgColor='#ff6600';"
onmouseout="javascript:this.bgColor='#0066CC';" align=middle><A
href="http://218.106.165.186/Communion/index/index.asp"><FONT
color=white>技術交流</FONT></A></TD>
<TD onmouseover="javascript:this.bgColor='#ff6600';"
onmouseout="javascript:this.bgColor='#0066CC';" align=middle><A
href="http://218.106.165.186/Eden/index/index.asp"><FONT color=white>半 山
亭</FONT></A></TD>
<TD onmouseover="javascript:this.bgColor='#ff6600';"
onmouseout="javascript:this.bgColor='#0066CC';" align=middle><A
href="http://218.106.165.186/Develop/index/index.asp"><FONT
color=white>站務相關</FONT></A></TD></TR></TBODY></TABLE>
<META content=[轉貼]實用電子秤5/5 name=keywords>
<META content=[轉貼]實用電子秤5/5 name=description><LINK
href="[轉貼]實用電子秤5-5.files/main.css" type=text/css rel=stylesheet>
<SCRIPT language=JavaScript type=text/JavaScript>
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</SCRIPT>
<SCRIPT>
var aw = screen.availWidth;
var ah = screen.availHeight;
window.moveTo(0,0);
window.resizeTo(aw,ah);
</SCRIPT>
<STYLE type=text/css>BODY {
BACKGROUND-IMAGE: url(../../index/images/background.jpg)
}
</STYLE>
<TABLE cellSpacing=0 cellPadding=0 width=800 bgColor=#c4d5fd border=0>
<TBODY>
<TR>
<TD height=3></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=5 cellPadding=0 width=790 align=center bgColor=#ffffff
border=0>
<TBODY>
<TR>
<TD align=middle
height=3>----------------------------------------------------------------------------------------------------------------------------------</TD></TR>
<TR>
<TD height=5></TD></TR>
<TR>
<TD align=middle width=790><SPAN
style="FONT-SIZE: 15pt; COLOR: black; FONT-FAMILY: 宋體; LETTER-SPACING: 0pt"><B>[轉貼]實用電子秤5/5</B></SPAN></TD></TR>
<TR>
<TD height=5></TD></TR>
<TR>
<TD><FONT color=#000000>
<P class=style27 align=center><STRONG>第五部分:附錄 </STRONG></P>
<P class=style27>電子秤的信號采集、處理、顯示的程序 . </P>
<P class=style27>#include <reg52.h> </P>
<P class=style27>#include<absacc.h> </P>
<P class=style27>//ad 控制線 </P>
<P class=style27>#define ad_244 XBYTE[0xbfff]; </P>
<P class=style27>sbit ad_stb=P3^3; </P>
<P class=style27>sbit ad_start=P1^1; </P>
<P class=style27>//lcd 控制線 </P>
<P class=style27>sbit lcd_di=P1^7; </P>
<P class=style27>sbit lcd_rw=P1^2; </P>
<P class=style27>sbit lcd_e=P1^0; </P>
<P class=style27>//7289 控制線 </P>
<P class=style27>sbit cs7289=P1^3; </P>
<P class=style27>sbit clk7289=P1^4; </P>
<P class=style27>sbit dio7289=P1^5; </P>
<P class=style27>//sbit key7289=P1^6; //7289 查詢方式 </P>
<P class=style27>sbit key7289=P3^2; //7289 中斷方式 </P>
<P class=style27>sbit baoj=P3^5; </P>
<P class=style27>//7289 子程序 </P>
<P class=style27>void ini_7289(void); </P>
<P class=style27>void send7289(short); </P>
<P class=style27>short receive(void); </P>
<P class=style27>void keyin(void); </P>
<P class=style27>//lcd 子程序 </P>
<P class=style27>void ini_lcd(void); </P>
<P class=style27>void lcdd_send(short); </P>
<P class=style27>void lcdi_send(short); </P>
<P class=style27>void chk_busy(void); </P>
<P class=style27>//ad 子程序 </P>
<P class=style27>void ad(void); </P>
<P class=style27>void baojing(void); </P>
<P class=style27>void d_change(long); </P>
<P class=style27>// 初始化,編號,日期 </P>
<P class=style27>void ini(); </P>
<P class=style27>void error1(void); </P>
<P class=style27>void nop1() </P>
<P class=style27>{} </P>
<P class=style27>void change(s) </P>
<P class=style27>int dealy; // 全局變量 </P>
<P class=style27>short sh=0; // 商品號 </P>
<P class=style27>short dot=0; // 小數點標志 </P>
<P class=style27>bit list=0; </P>
<P class=style27>short qb=0; </P>
<P class=style27>char xdata shuju[7]=""; </P>
<P class=style27>short xdata bcd[5]; </P>
<P class=style27>char xdata s1[16]=" 單價 : 元 "; </P>
<P class=style27>char xdata s2[16]=" 重量 : Kg"; </P>
<P class=style27>char xdata s3[16]=" 金額 : 元 "; </P>
<P class=style27>char xdata s4[16]=" 累計 : 元 "; </P>
<P class=style27>char code message0[]=" 信息學院 山東大學 "; </P>
<P class=style27>char code message1[]=" 輸入收銀員代號 :"; </P>
<P class=style27>char code message2[]=" 輸入日期 :"; </P>
<P class=style27>char code message3[16]=" -- 山東大學 -- "; </P>
<P class=style27>char code message5[16]=" 垃圾公司歡迎您 !!"; </P>
<P class=style27>char xdata bianhao[16]=" 收銀員: "; </P>
<P class=style27>char xdata riqi[16]=" - - "; </P>
<P class=style27>long int xdata zongjia=0,jine=0,jine1=0; </P>
<P class=style27>int xdata shizhong=0,pizhong=0,zhongliang=0; </P>
<P class=style27>long int xdata qingdan[20][4]; </P>
<P class=style27>char code shangpin[11][4]={{" 單價 "},{" 蘋果 "},{" 梨
"},{" 花生 "},{" 大米 "}, </P>
<P class=style27>{" 桃子 "},{" 塑料 "},{" 瓜子 "},{" 桔子 "},{" 香蕉 "},{" 玉米
"}}; </P>
<P class=style27>long int xdata danjia[11]= </P>
<P
class=style27>{0,2000,3635,5502,6660,3320,5502,660,3210,6600,5600};
</P>
<P class=style27>char xdata jiage[6]={0x0,0x0,0x0,0xfe,0x0,0x0}; //
0.00 </P>
<P class=style27>short xdata xiuzheng[]={0,2,5,6,7,8,9,12,13}; </P>
<P class=style27>char s[16]; </P>
<P class=style27>{s[6]=shuju[0]; </P>
<P class=style27>s[7]=shuju[1]; </P>
<P class=style27>s[8]=shuju[2]; </P>
<P class=style27>s[9]=shuju[3]; </P>
<P class=style27>s[10]=shuju[4]; </P>
<P class=style27>s[11]=shuju[5]; </P>
<P class=style27>s[12]=shuju[6]; </P>
<P class=style27>} </P>
<P
class=style27>//****************************************************************
</P>
<P class=style27>void main() </P>
<P class=style27>{short i,j; </P>
<P class=style27>long int x,z; </P>
<P class=style27>int y; </P>
<P class=style27>int xdata duilie[3]={0}; </P>
<P class=style27>P1=0xff; </P>
<P class=style27>ini_lcd(); // 初始化 LCD </P>
<P class=style27>lcdi_send(0x8a); </P>
<P class=style27>while(message0[i]) lcdd_send(message0[i++]); </P>
<P class=style27>ini_7289(); // 初始化 7289 </P>
<P class=style27>pizhong=ad1(); </P>
<P class=style27>lcdi_send(0x1); // 總清 屏 </P>
<P class=style27>ini(); // 初始頁面 , 收銀員編號,日期 </P>
<P class=style27>lcdi_send(0x1); // 總清 屏 </P>
<P class=style27>EA=1;EX0=1; // 中斷 </P>
<P class=style27>//EX1=1; </P>
<P class=style27>//ad_start=1; </P>
<P class=style27>while(1) </P>
<P class=style27>{if(list){lcdi_send(0x80); // 顯示單位名稱 </P>
<P class=style27>for(i=0;i<16;i++) lcdd_send(message3[i]); </P>
<P class=style27>x=qingdan[0][0]; // 商品名 單價 </P>
<P class=style27>for(i=0;i<4;i++) s1[i]=shangpin[x][i]; </P>
<P class=style27>x=qingdan[0][1]; </P>
<P class=style27>d_change(x); change(s1); </P>
<P class=style27>lcdi_send(0x90); </P>
<P class=style27>for(i=0;i<16;i++) lcdd_send(s1[i]); </P>
<P class=style27>x=qingdan[0][2]; // 顯示重量 </P>
<P class=style27>d_change(x); change(s2); </P>
<P class=style27>s2[10]=s2[9];s2[9]='.'; </P>
<P class=style27>if(s2[8]==32) s2[8]=0x30; </P>
<P class=style27>lcdi_send(0x88); </P>
<P class=style27>for(i=0;i<16;i++) lcdd_send(s2[i]); </P>
<P class=style27>x=qingdan[0][3]; </P>
<P class=style27>d_change(x); change(s3); </P>
<P class=style27>lcdi_send(0x98); </P>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -