触摸屏主程序_第1页
触摸屏主程序_第2页
触摸屏主程序_第3页
触摸屏主程序_第4页
触摸屏主程序_第5页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、.#include #include #includeusart.h#define f_red 0xf800#define f_black 0x0000#define f_blue 0x07e0 const uchar onsale1030=服装类:,冬装服饰一律七折优惠, 水果类:,香蕉特价1.48元/斤,饮料类:,百事可乐七喜双提9.8元,日用品类:,2l装立白洗洁精12.45元,化妆品类:,曼秀雷敦润唇膏15元两支;const uchar fruit1030=菠萝 3.40元/斤,橙子 4.00元/斤,冬枣 8.00元/斤, 芒果 25.00元/斤,桂圆 6.70元/斤,红提 8.00元

2、/斤,山竹 30.00元/斤,榴莲 10.00元/斤,西瓜 3.00元/斤,葡萄 7.00元/斤;const uchar vegetable1030=圆白菜 0.90元/斤,小白菜 3.00元/斤,波菜 1.30元/斤, 白萝卜 0.90元/斤,甘蓝 1.20元/斤,生菜 3.20元/斤,西芹 2.00元/斤,蒜苗 2.70元/斤,油菜 2.10元/斤,茼蒿 5.50元/斤;const uchar snack1030=曲奇系列:, 趣多多咖啡味 12.0元,迪士尼桶装曲奇 46.0元, 丹麦皇冠曲奇 10.8元,新西兰牛油曲奇 20.0元,膨化食品系列:,浪味仙蔬菜味 4.0元,乐吧薯片 1.

3、5元,旺仔小馒头 7.0元,乐事薯片原味 7.8元;const uchar drink1030=茶饮系列:, 康师傅茉莉清茶500ml 2.5元,康师傅茉莉蜜茶500ml 2.5元,康师傅茉莉花茶500ml 2.5元,统一冰红茶500ml 2.5元,碳酸饮料系列:,精品.百事可乐600ml 3.5元,可口可乐600ml 3.5元,美年达600ml 3.5元,雪碧600ml 3.5元;const uchar cosmetic1030=相宜本草系列:, 红景天幼白精华水 69元,四倍蚕丝凝白面膜 67元, 八杯水面霜 33元,光彩立现睡眠面膜 30元,佰草集系列:,玉润保湿眼部啫喱 230元,玉润

4、保湿洁面泡 74元,紧肤化妆水 10元,平衡洁面乳 42元;const uchar clothing1030=女装:, 针织衫 35元,短外套 90元, 衬衫 159元,毛衣 130元,男装:,牛仔裤 180元,夹克 450元,衬衫 140元,卫衣 110元;void delay(uint ms) uint i,j;for(i=0;ims;i+) for(j=0;j8); /发送x地址高八位 usart_transmit_zero(x); /发送x地址低八位 usart_transmit_zero(y8);/发送y地址高八位 usart_transmit_zero(y);/发送y地址低八位 u

5、sart_transmit_zero(0x21); /字库:gbk内码 usart_transmit_zero(0x82); /前景色显示,背景色不显示,字符编码方式gbk usart_transmit_zero(0x01); /16*16点阵 usart_transmit_zero(0x00); /前景色黑色 usart_transmit_zero(0x00); usart_transmit_zero(0x00); /背景色蓝色 usart_transmit_zero(0x1f); while(*pcstr) usart_transmit_zero(*pcstr+); frame_end()

6、;void lcd_lshow(uint fcolor,uint x,uint y, uchar *pcstr) frame_start(); usart_transmit_zero(x8); /发送x地址高八位 usart_transmit_zero(x); /发送x地址低八位 usart_transmit_zero(y8);/发送y地址高八位 usart_transmit_zero(y);/发送y地址低八位 usart_transmit_zero(0x23); /字库:gb2312内码 usart_transmit_zero(0x81); /前景色显示,背景色不显示,字符编码方式gb231

7、2 usart_transmit_zero(0x03); /32*32点阵 usart_transmit_zero(fcolor8); /前景色预设 usart_transmit_zero(fcolor); usart_transmit_zero(0x00); /背景色蓝色 usart_transmit_zero(0x1f); usart_transmit_zero_string(pcstr); frame_end();void pic_show(uint p) usart_transmit_zero(0xaa); usart_transmit_zero(0x70);精品. usart_tra

8、nsmit_zero(p); frame_end(); /#pragma interrupt_handler isr1:31main() uint i;uint j=0;/uchar p;uint y=0; cli(); uart_init(); sei(); /usart_transmit_zero_string(12);/usart_transmit_fist_string(34);pic_show(10);lcd_lshow(f_red,91,49,欢迎光临);lcd_lshow(f_red,67,134,祝您购物愉快);delay(3000);while(1); while(!adve

9、r) for(i=6;i9;i+) pic_show(i); delay(1000); if(adver=1) break; if(flag) switch(rx_buffer3) case 0x02: /打折信息 /p=disp1; for(i=0;i10;i+) lcd_show(0,y,onsalej+);精品. y=y+24;/字符显示坐标y向下移动 i=0;y=0;j=0; break;case 0x05: /水果信息 for(i=0;i10;i+) lcd_show(0,y,fruitj+); y=y+24; i=0;y=0x00;j=0; break;case 0x06: /蔬菜

10、信息 for(i=0;i10;i+) lcd_show(0,y,vegetablej+); y=y+24; i=0;y=0x00;j=0; break;case 0x07: /零食信息 for(i=0;i10;i+) lcd_show(0,y,snackj+); y=y+24; i=0;y=0x00;j=0; break;case 0x08: /饮料信息 for(i=0;i10;i+) lcd_show(0,y,drinkj+); y=y+24; i=0;y=0x00;j=0; break;case 0x09: /化妆品信息 for(i=0;i10;i+) lcd_show(0,y,cosmetic

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论