i'm using some motors ( some weak ones, and some hard core ones ) to set up a sample test with a joystick, and i want it to be bi directional, for instance, when i press the joystick left, the motor will spin left, and when i press right, the motor will spin to the right.
i now know reversing the voltage on the wires will infact turn the motor the opposite direction, but i also know connecting the motor from one pin to another is bad. and i think that i need a connection to 2 pins and a connection to ground, but i only have 2 wires, and i don't wanna short the arduino!
is there a way to safely hook it up, so even if i do connect two pins, or i connect bad to bad, no damage will be done?
secondary question:
i have a 5v motor that kills the arduino if i hook it up, and i want to be able to pwm it, so is an opto coupler good, or is there a diffrent way to do it with pwm?
and, can i opto couple it with things i have lying around, photodiode, resistors, led, potentiometers, switches?
thanks in advance!
-int big = 93;