static void LCD_en_com(unsigned char command)
{
LCD1602_DB7=(command7)%2;
LCD1602_DB6=(command6)%2;
LCD1602_DB5=(command5)%2;
LCD1602_DB4=(command4)%2;
LCD1602_RS = 0; //RS 0
LCD1602_RW = 0; //RW 0
LCD1602_EN = 1; //EN --\|/__ Write command
delay(2);
LCD1602_EN = 0;
LCD1602_DB7=(command3)%2;
LCD1602_DB6=(command2)%2;
LCD1602_DB5=(command1)%2;
LCD1602_DB4=(command0)%2;
LCD1602_RS = 0; //RS 0
LCD1602_RW = 0; //RW 0
LCD1602_EN = 1; //EN --\|/__ Write command
delay(2); LCD1602_EN = 0;
}
单步运行,到LCD1602_DB7=(command7)%2; 行,就出现10楼的图片,实在没办法了,
只好把函数static void LCD_en_com(unsigned char command)
改成static void LCD_en_com(unsigned int command),
但是这么一改(char 改成int),居然程序跑起来,运行正常了。
不知道有谁能解释一下?