void Dis_menu() { if(menu == 0) { LCD_Clear(); LCD_Write_String(0,0,"00:00:00"); LCD_Write_String(0,1,"00-00 Hum: %"); } else if(menu == 1) { LCD_Clear(); LCD_Write_String(0,0," Set time "); LCD_Write_String(0,1,"00-00 00:00:00 "); LCD_Write_Char(0,1,yue/16%16+0x30);LCD_Write_Char(1,1,yue%16+0x30); LCD_Write_Char(3,1,ri/16%16+0x30);LCD_Write_Char(4,1,ri%16+0x30); LCD_Write_Char(6,1,shi/16%16+0x30);LCD_Write_Char(7,1,shi%16+0x30); LCD_Write_Char(9,1,fen/16%16+0x30);LCD_Write_Char(10,1,fen%16+0x30); LCD_Write_Char(12,1,miao/16%16+0x30);LCD_Write_Char(13,1,miao%16+0x30); } else if(menu ==6) { LCD_Clear(); LCD_Write_String(0,0," Set chun "); LCD_Write_String(0,1," 00-00-00 S: "); LCD_Write_Char(1,1,A_shi/16%16+0x30);LCD_Write_Char(2,1,A_shi%16+0x30); LCD_Write_Char(4,1,A_fen/16%16+0x30);LCD_Write_Char(5,1,A_fen%16+0x30); LCD_Write_Char(7,1,A_miao/16%16+0x30);LCD_Write_Char(8,1,A_miao%16+0x30); LCD_Write_Number(13,1,shui1*10,3); } else if(menu ==10) { LCD_Clear(); LCD_Write_String(0,0," Set xia "); LCD_Write_String(0,1," 00-00-00 S: "); LCD_Write_Char(1,1,B_shi/16%16+0x30);LCD_Write_Char(2,1,B_shi%16+0x30); LCD_Write_Char(4,1,B_fen/16%16+0x30);LCD_Write_Char(5,1,B_fen%16+0x30); LCD_Write_Char(7,1,B_miao/16%16+0x30);LCD_Write_Char(8,1,B_miao%16+0x30); LCD_Write_Number(13,1,shui2*10,3); } else if(menu ==14) { LCD_Clear(); LCD_Write_String(0,0," Set qiu "); LCD_Write_String(0,1," 00-00-00 S: "); LCD_Write_Char(1,1,C_shi/16%16+0x30);LCD_Write_Char(2,1,C_shi%16+0x30); LCD_Write_Char(4,1,C_fen/16%16+0x30);LCD_Write_Char(5,1,C_fen%16+0x30); LCD_Write_Char(7,1,C_miao/16%16+0x30);LCD_Write_Char(8,1,C_miao%16+0x30); LCD_Write_Number(13,1,shui3*10,3); } else if(menu ==18) { LCD_Clear(); LCD_Write_String(0,0," Set dong "); LCD_Write_String(0,1," 00-00-00 S: "); LCD_Write_Char(1,1,D_shi/16%16+0x30);LCD_Write_Char(2,1,D_shi%16+0x30); LCD_Write_Char(4,1,D_fen/16%16+0x30);LCD_Write_Char(5,1,D_fen%16+0x30); LCD_Write_Char(7,1,D_miao/16%16+0x30);LCD_Write_Char(8,1,D_miao%16+0x30); LCD_Write_Number(13,1,shui4*10,3); } else if(menu ==22) { LCD_Clear(); LCD_Write_String(0,0,"Hum_L:"); LCD_Write_Number(6,0,hum_l,3); } } 对这段代码进行逐条注释
时间: 2023-11-22 19:53:37 浏览: 185
```c++
void Dis_menu() { //定义函数Dis_menu
if(menu == 0) { //如果当前菜单为0
LCD_Clear(); //清空LCD显示
LCD_Write_String(0,0,"00:00:00"); //在第0行第0列写入"00:00:00"
LCD_Write_String(0,1,"00-00 Hum: %"); //在第1行第0列写入"00-00 Hum: %"
} else if(menu == 1) { //如果当前菜单为1
LCD_Clear(); //清空LCD显示
LCD_Write_String(0,0," Set time "); //在第0行第0列写入" Set time "
LCD_Write_String(0,1,"00-00 00:00:00 "); //在第1行第0列写入"00-00 00:00:00 "
LCD_Write_Char(0,1,yue/16%16+0x30);LCD_Write_Char(1,1,yue%16+0x30); //在第1行第0列写入月份的十位数和个位数
LCD_Write_Char(3,1,ri/16%16+0x30);LCD_Write_Char(4,1,ri%16+0x30); //在第1行第3列写入日期的十位数和个位数
LCD_Write_Char(6,1,shi/16%16+0x30);LCD_Write_Char(7,1,shi%16+0x30); //在第1行第6列写入小时的十位数和个位数
LCD_Write_Char(9,1,fen/16%16+0x30);LCD_Write_Char(10,1,fen%16+0x30); //在第1行第9列写入分钟的十位数和个位数
LCD_Write_Char(12,1,miao/16%16+0x30);LCD_Write_Char(13,1,miao%16+0x30); //在第1行第12列写入秒钟的十位数和个位数
} else if(menu ==6) { //如果当前菜单为6
LCD_Clear(); //清空LCD显示
LCD_Write_String(0,0," Set chun "); //在第0行第0列写入" Set chun "
LCD_Write_String(0,1," 00-00-00 S: "); //在第1行第0列写入" 00-00-00 S: "
LCD_Write_Char(1,1,A_shi/16%16+0x30);LCD_Write_Char(2,1,A_shi%16+0x30); //在第1行第1列写入春季开始时间的小时的十位数和个位数
LCD_Write_Char(4,1,A_fen/16%16+0x30);LCD_Write_Char(5,1,A_fen%16+0x30); //在第1行第4列写入春季开始时间的分钟的十位数和个位数
LCD_Write_Char(7,1,A_miao/16%16+0x30);LCD_Write_Char(8,1,A_miao%16+0x30); //在第1行第7列写入春季开始时间的秒钟的十位数和个位数
LCD_Write_Number(13,1,shui1*10,3); //在第1行第13列写入水位的值
} else if(menu ==10) { //如果当前菜单为10
LCD_Clear(); //清空LCD显示
LCD_Write_String(0,0," Set xia "); //在第0行第0列写入" Set xia "
LCD_Write_String(0,1," 00-00-00 S: "); //在第1行第0列写入" 00-00-00 S: "
LCD_Write_Char(1,1,B_shi/16%16+0x30);LCD_Write_Char(2,1,B_shi%16+0x30); //在第1行第1列写入夏季开始时间的小时的十位数和个位数
LCD_Write_Char(4,1,B_fen/16%16+0x30);LCD_Write_Char(5,1,B_fen%16+0x30); //在第1行第4列写入夏季开始时间的分钟的十位数和个位数
LCD_Write_Char(7,1,B_miao/16%16+0x30);LCD_Write_Char(8,1,B_miao%16+0x30); //在第1行第7列写入夏季开始时间的秒钟的十位数和个位数
LCD_Write_Number(13,1,shui2*10,3); //在第1行第13列写入水位的值
} else if(menu ==14) { //如果当前菜单为14
LCD_Clear(); //清空LCD显示
LCD_Write_String(0,0," Set qiu "); //在第0行第0列写入" Set qiu "
LCD_Write_String(0,1," 00-00-00 S: "); //在第1行第0列写入" 00-00-00 S: "
LCD_Write_Char(1,1,C_shi/16%16+0x30);LCD_Write_Char(2,1,C_shi%16+0x30); //在第1行第1列写入秋季开始时间的小时的十位数和个位数
LCD_Write_Char(4,1,C_fen/16%16+0x30);LCD_Write_Char(5,1,C_fen%16+0x30); //在第1行第4列写入秋季开始时间的分钟的十位数和个位数
LCD_Write_Char(7,1,C_miao/16%16+0x30);LCD_Write_Char(8,1,C_miao%16+0x30); //在第1行第7列写入秋季开始时间的秒钟的十位数和个位数
LCD_Write_Number(13,1,shui3*10,3); //在第1行第13列写入水位的值
} else if(menu ==18) { //如果当前菜单为18
LCD_Clear(); //清空LCD显示
LCD_Write_String(0,0," Set dong "); //在第0行第0列写入" Set dong "
LCD_Write_String(0,1," 00-00-00 S: "); //在第1行第0列写入" 00-00-00 S: "
LCD_Write_Char(1,1,D_shi/16%16+0x30);LCD_Write_Char(2,1,D_shi%16+0x30); //在第1行第1列写入冬季开始时间的小时的十位数和个位数
LCD_Write_Char(4,1,D_fen/16%16+0x30);LCD_Write_Char(5,1,D_fen%16+0x30); //在第1行第4列写入冬季开始时间的分钟的十位数和个位数
LCD_Write_Char(7,1,D_miao/16%16+0x30);LCD_Write_Char(8,1,D_miao%16+0x30); //在第1行第7列写入冬季开始时间的秒钟的十位数和个位数
LCD_Write_Number(13,1,shui4*10,3); //在第1行第13列写入水位的值
} else if(menu ==22) { //如果当前菜单为22
LCD_Clear(); //清空LCD显示
LCD_Write_String(0,0,"Hum_L:"); //在第0行第0列写入"Hum_L:"
LCD_Write_Number(6,0,hum_l,3); //在第0行第6列写入湿度低值的值
}
}
```
阅读全文