Hi,
I am having trouble with some code that I have written. The code is inspired by a limit switch tutorial and then modified for my project.
I am making an automatic dog ball launcher for my dog and am using a limit switch to control a relay and a servo (The relay powers a weedwhacker motor that runs on wall power).
For some reason, the relay stays on when the switch is not active and the servo spins randomly. I do not think that this is a problem to do with the hardware as I have built the circuit three times and it hasn't worked for two of them.
If anyone can help me it is greatly appreciated.
Cheers.
Here is the code for you all to see:
`#include <Arduino.h>
Sorry, I am new to the Arduino forum. How do I use code tags? This is how I wrote it in my code along with the tutorial so I don't know how I could format it to a greater ability.