文件名称:洗衣机单片机
文件大小:5KB
文件格式:C
更新时间:2016-04-20 03:57:34
洗衣机单片机
洗衣机的c语言程序,非常重要是我们用的t COL1=P1^3;//点阵左起第2列控制口 sbit COL2=P1^4;//点阵左起第3列控制口 sbit COL3=P1^5;//点阵左起第4列控制口 sbit LED=P1^6;//指示灯亮 sbit KS=P2^0; //开始按钮 sbit KA3=P2^1;//继电器高水位控制 sbit KA4=P2^2;//继电器中水位控制 sbit KA5=P2^3;//继电器低水位控制 sbit SB1=P2^4;//高水位控制 sbit SB2=P2^5;//中水位控制 sbit SB3=P2^6;//低水位控制 sbit SB4=P2^7; //进水阀门控制 uchar a=0;b=0;time=0; uchar second=0; uchar date[11]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff};//0-9数字、最后一个关闭 uchar wei[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};//位选数码管 uchar shuzi[2]={0,0};// 数字缓冲区 uchar code hanzi_zh[][64]= //汉子数据表 { /*进*/{0x00,0x90,0x20,0x90,0x10,0x90,0x13,0xFC,0x00,0x90,0x00,0x90,0xF0,0x90,0x17,0xFE, 0x10,0x90,0x10,0x90,0x11,0x10,0x11,0x10,0x12,0x10,0x28,0x00,0x47,0xFE,0x00,0x00, /*水*/0x01,0x00,0x01,0x00,0x01,0x08,0x01,0x10,0x7D,0x20,0x05,0xC0,0x05,0x40,0x09,0x20, 0x09,0x20,0x11,0x10,0x11,0x18,0x21,0x0E,0xC1,0x04,0x01,0x00,0x05,0x00,0x02,0x00, }, /*洗*/{ 0x40,0x40,0x22,0x40,0x22,0x40,0x07,0xF8,0x94,0x40,0x58,0x40,0x50,0x40,0x1F,0xFE, 0x21,0x20,0x21,0x20,0xE1,0x20,0x22,0x20,0x22,0x22,0x24,0x22,0x28,0x1E,0x20,0x00, /*衣*/ 0x02,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00,0x01,0x00,0x03,0x08,0x04,0x8C,0x08,0x90, 0x18,0x60,0x28,0x40,0x48,0x20,0x88,0x20,0x08,0x10,0x0A,0x0E,0x1C,0x04,0x08,0x00, }, /*甩*/{0x00,0x00,0x3F,0xF8,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x21,0x08,0x3F,0xF8, 0x21,0x08,0x21,0x08,0x21,