'Howdy Everybody,
I am finally getting some time to work on my gate opener inteface controller.
I am having a hard time figuring out how to set a pin high for a desired time after a input pin signal has been recieved.
{ if ((P2IN & REMOTE) ==0) //P2.0 input from gate opener second channel contact P2OUT |= BYPASS; // output high on P2.2 _delay_cycles(500000); if ((POSITION) =0 //make bypass stay high until P2.1 goes low P2OUT &= ~BYPASS; _delay_cycles(500000) }
Will this work?
The whole system is
If there is a momentary input on P2.0 it will make an output on P2.2 until P2.1 returns to low for more than a half second. the timer is set at 1 mhZ
Thanks ! hopefully my codee writing skills will get better.