switch(key1n)
{
case 1:
switch(key3n)
{
case 1:
lcd_wcmd(0x80); //一号阀自动
lcd_wdat(0x31); //1
lcd_wdat(0x23); //#
lcd_wdat(0xd7);
lcd_wdat(0xd4); //自
lcd_wdat(0xb6);
lcd_wdat(0xaf); //动
lcd_wcmd(0x90); //在第二行显示:是
lcd_wdat(0xca);
lcd_wdat(0xc7); //是
lcd_wdat(0x20);
lcd_wdat(0x20); //空格
lcd_wcmd(0x88); //在第三行显示:否
lcd_wdat(0xb7);
lcd_wdat(0xf1); //否
lcd_wdat(0x20);
lcd_wdat(0x20); //空格
lcd_wcmd(0x0c); //将光标关掉
break;
case 2:
flag=1;
lcd_wcmd(0x80); //一号阀自动
lcd_wdat(0x31); //1
lcd_wdat(0x23); //#
lcd_wdat(0xb7); //阀
lcd_wdat(0xa7);
lcd_wdat(0x20); //空格
lcd_wdat(0x20);
lcd_wcmd(0x90);
lcd_wdat(0x20); //空格
lcd_wdat(0x20);
lcd_wdat(0x20);
lcd_wdat(0x20);
lcd_wcmd(0x88);
lcd_wdat(0xd7);
lcd_wdat(0xd4);
lcd_wdat(0xb6);
lcd_wdat(0xaf);
lcd_wcmd(0x0c); //将光标关掉
break;
default:
flag=0;
key3n=0;
// xianshi();
lcd_wcmd(0x80); //一号开阀
lcd_wdat(0x31); //1
lcd_wdat(0x23); //#
lcd_wdat(0xbf);
lcd_wdat(0xaa); //开
lcd_wcmd(0x90); //一号阀停止
lcd_wdat(0x31); //1
lcd_wdat(0x23); //#
lcd_wdat(0xcd); //停
lcd_wdat(0xa3);
lcd_wcmd(0x88); //一号关阀
lcd_wdat(0x31); //1
lcd_wdat(0x23); //#
lcd_wdat(0xb9); //关
lcd_wdat(0xd8);
lcd_wcmd(0x82);
lcd_wdat(0x20);
lcd_wdat(0x20); //空格
lcd_wcmd(0x0c);
// break;
}
case 2:
switch(key3n)
{
case 1:
flag=0;
flag1=1;
// xianshi();
lcd_wcmd(0x80); //显示:手
lcd_wdat(0xca);
lcd_wdat(0xd6); // 手
lcd_wdat(0x20);
lcd_wdat(0x20);
break;
default:
flag1=0;
key3n=0;
// xianshi();
lcd_wcmd(0x80); //一号开阀
lcd_wdat(0x31); //1
lcd_wdat(0x23); //#
lcd_wdat(0xbf);
lcd_wdat(0xaa); //开
lcd_wcmd(0x82);
lcd_wdat(0x20); //空格
lcd_wdat(0x20);
lcd_wcmd(0x0c);
// break;
} |