|
我做的这个是用yl-69 土壤湿度传感器检测湿度然后用adC0832模数转换然后交给单片机判断的,仿真里面的可以实现,但是实物焊接出来我把土壤湿度传感器全部放到水里,lcd1602显示的当前湿度还是0,请问这个是我程序的问题吗?
void LCD1602Show()
{
if(state==0)
{
LCD1602Write(0,0x80); LCD1602Write_byte("Humidity:")
LCD1602Write(0,0x80+9);
if(RH>99)LCD1602Write(1,0x30+RH/100%10);
else LCD1602Write_byte(" ");
LCD1602Write(0,0x80+10);
if(RH>9)LCD1602Write(1,0x30+RH/10%10);
else LCD1602Write_byte(" ");
LCD1602Write(0,0x80+11);
LCD1602Write(1,0x30+RH%10);
LCD1602Write(0,0x80+12);
LCD1602Write_byte("% ");
LCD1602Write(0,0xC0);
LCD1602Write_byte(" ");
// LCD1602Write(0,0xC0+6);
// if(Flag==1)
// {
// LCD1602Write_byte(" ");//ÏÔʾÁ½ÖÖģʽ
// }
// else
// {
// LCD1602Write_byte("Manul ");
// }
}else
{
LCD1602Write(0,0x80);
LCD1602Write_byte("RH_H:");
LCD1602Write(0,0x80+5);
if(state==1&&Flag1==1)
{
LCD1602Write_byte(" ");
}else
{
if(RH_H>99)LCD1602Write(1,0x30+RH_H/100%10)
else LCD1602Write_byte(" ");
LCD1602Write(0,0x80+6);
if(RH_H>9)LCD1602Write(1,0x30+RH_H/10%10);
else LCD1602Write_byte(" ");
LCD1602Write(0,0x80+7);
LCD1602Write(1,0x30+RH_H%10);
}
LCD1602Write(0,0x80+8);
LCD1602Write_byte("% ");
LCD1602Write(0,0xC0);
LCD1602Write_byte("RH_L:");
LCD1602Write(0,0xC0+5);
if(state==2&&Flag1==1)
{
LCD1602Write_byte(" ");
}else
{
if(RH_L>99)LCD1602Write(1,0x30+RH_L/100%10);
else LCD1602Write_byte(" ");
LCD1602Write(0,0xC0+6);
if(RH_L>9)LCD1602Write(1,0x30+RH_L/10%10);
else LCD1602Write_byte(" ");
LCD1602Write(0,0xC0+7);
LCD1602Write(1,0x30+RH_L%10);
}
LCD1602Write(0,0xC0+8);
LCD1602Write_byte("% ");
}
}
|
|