jkashiwada
New Member
Hello All,
I've switched from assembly to C using MikroC. I still wish only to display a message to my LCD if an input pin goes high. I don't have my code with me but it is very simple. Under main i do the following
ANSEL = 0;
ANSELH = 0;
PORTD = 0; // clear port D
TRISD = 0xFF; // Set port D as input
while (1) {
if (PORTD,0 == 0) {
Lcd_Out(1,1,"RD0 is low");
}else{
Lcd_Out(1,1,"RD0 is high");
}
}
when i run this the lcd only says "RD0 is low" regardless of the input i give. Is there some register or setting, or configuration bit i must set or not set? Any advice would be greatly appreciated.
Thanks =)
Jake
I've switched from assembly to C using MikroC. I still wish only to display a message to my LCD if an input pin goes high. I don't have my code with me but it is very simple. Under main i do the following
ANSEL = 0;
ANSELH = 0;
PORTD = 0; // clear port D
TRISD = 0xFF; // Set port D as input
while (1) {
if (PORTD,0 == 0) {
Lcd_Out(1,1,"RD0 is low");
}else{
Lcd_Out(1,1,"RD0 is high");
}
}
when i run this the lcd only says "RD0 is low" regardless of the input i give. Is there some register or setting, or configuration bit i must set or not set? Any advice would be greatly appreciated.
Thanks =)
Jake