Thank you all for the input so far. And indeed, I am new with pic programming. Knowledge of basic language and electronics for many years. This kind of switching solution was done by a 4027 JK flipflop. But it's time to move on and use a micro controller. And more of a challenge then i expected!
Anyway, to be more precise about the question asked:
a micro switch in a machine is standard closed by a magnet.
When the switch opens, so goes from 0 to 1 (logical) a relais must be activated. When the magnet returns and the switch goes back to 0, doe nothing
Again when the switch opens again toggle the relais. All with sufficient code to avoid bouncing.
'
Quite simpel i think but several programs i tried don't work as good as a 4027. "Probably" due to the fact that i am a new-be....
I'l look into the two solutions mentioned and let you know. Thanks again.
Koert.




Bookmarks