If you want to use only Pin1,2,and 3,and no extra pin, then use an analog input pin on pin1. connect two 10k resistor from GND to VCC, and connect the middle point to Pin1:
VCC–^v–PIN1–v^----GND
drive Pin2 high, and Pin3 low.
keep reading PIN1 analog inpout and based on your reading:
If Pin1 close to 0, then P1<->P3
if pin1 close to 255(8 bit analog) then P1<->P2
if pin1 is close to 125(8 bit analog, maybe ±20) then P1 is disconnected from P2 and P3.
Sorry about that, here is what I am trying to build, A suntracker using Arduino board, a GPS shield and motor control.
The motor control is "LED3XS24Vc3RM " board from Redrok
The board has 4 wires 1-4 to control a motor with external power supply ( there are also addition 4 connectors , two for motor and two external power supply for motor)....
Wire 1 is a power pin and need 5v, which it can be provided from Arduino board, pin 2-3 need to be programmed as follow:
Leaving CONN2-pin2 and CONN2-pin3 open will cause the PU to drive the motor Reverse or to the Red direction. This is also the "Parking" direction.
Connecting CONN2-pin3 to CONN2-pin4 will cause the PU to stop moving the motor.
Connecting CONN2-pin2 to CONN2-pin4 will cause the PU to drive the motor Forward
Thanks for prompt response..... using transistors were my first option, however I did not know which one nor how to use them in this case, I will try your recommendations after locating the transistor.
thx
Amir
PIN 1 is power (5v) Note: it an be provided by Arduino board
PIN 2-4 is control pins:
Cond 1: P4 <-> P2 … forward move
Cond 2: P4 <-> P3 ---- Stop
Cond 3: P4 not connected … Reverse move (open)
The info on Web site is very confusing, what I got from designer of the board, he emailed me and writes the board needs 5V power that needs to be supply in Pin 1, other pins 2-4 are control pins ( Pin 4 been GND). I have tested the board manually and it does work..... the only issue is how to control them via code.
Conn2 is external power suppy and motor, take a close look at Conn1 in the diagram, there are two LEDs (LED3) above it, these are pin 2 and 3, they are labled BLACK, GREEN and RED.
I have Pin 1 of the Conn1 connected to 5V Arduino and it is working and so far I have managed not to destory my Arduino board...
You are correct, my error, however I am looking at board, thus, how I managed not to toast my board.... I am still waiting for anyone who can tell me how to program for Pin 2 and 3 as it is describe in this email trail...