📄 [转贴]实用电子秤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 + -