Another question on these:
After getting the samples available on the wiki, I’m turning the relay on/off with the following piece of code (with an Arduino 2009):
void turnSwitchOnOff(byte sw)
I have some weird behaviours:
- sometimes it just work fine
- sometimes the signal is completely ignored (i.e. the switch does not do anything)
- sometimes it process two signals, so it turns on and then immediately off (or the opposite if the relay is alredy on)
I’d like to ask you if the code listed above is the correct way to handle this, and if you can suggest me how to investigate this issue.
Thanks a lot!