AnsweredAssumed Answered

to read a switch

Question asked by avdit kohli on Jul 23, 2014
Latest reply on Jul 24, 2014 by avdit kohli

Hi,

I am trying to read a mechanical switch to initialise a LCD every time the switch is turned ON. I use the following code :

if(ON==0)// is the switch OFF
{
delay_ms(8);
if(ON==1)// If turned ON
lcd_init();
}

 

The LCD does not initialise correctly when I turn ON the switch.

 

Regards,

Avdit

Outcomes