Re: Please look over my code
Sam,
the ";" simply denotes a comment. Any code after the ";" has no effect on the program other than to provide a comment anyone trying to figure out what the code is supposed to be doing.
the "!" is used in combination with the "=" and means "not equal".
From the PBP manual...
NOT EQUAL TO you can use either "<>" or "!="
so where he has
simply means open_led "is not equal to" open_led.
It causes the state of "open_led" to go to the opposite state. Similar to a "Toggle" command.
A couple of other things to consider...
Is there any chance of moisture accumulating on your PCB that would cause it to be erratic??
Is your power supply good and stable?
Why do you use an external ceramic resonator when the PIC has an internal 4MHz oscillator (not that this would cause you problems but it does reduce the I/O pins you have available.)
You might want to consider incorporating a gate open/closed sensor for positive indication of gate position.
dwight
Last edited by Heckler; - 27th March 2016 at 14:51.
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Bookmarks