Actually I have made some progress. I finally received the servo I had
ordered, and have since built the claw sub-assembly. The hardware for
the robot is complete unless I find some bugs that need to be worked
out. But anyway I'm having trouble getting the arduino to recognize
the IR commands. Here is just a brief summary of what I'm trying to
do:
I have wired an IR photo transistor to the arduino so that I may
receive IR signals from another circuit I've built. On a separate
bread board I've attached a pc joystick to a 399 comparator so that
when it is moved to any of the extremes the respective output pin on
the 399 chip will go from LOW to HIGH. The output pins in turn are
wired to separate 555 timers so that when one pin goes HIGH the 555
will pulse at a set frequency. The output of the 555s are all attached
to an IR emitting LED, which in turn is pointing towards the arduino
IR photo transistor. On the software side of the setup: The arduino
measures the microseconds that the IR photo transistor is HIGH and
then divides that value by 100. This value then goes into an array and
it does this process over until it gets 100 values for each extreme of
the joystick (left, right, up, down). After getting the 100 values the
program continues on to find the mode of each of the extremes. It
saves each of the 4 values into a separate array, I'll call these
values the reference pulses. Then we get into the main part of the
program. The arduino does nothing until the IR photo transistor goes
HIGH, it then measures the microseconds divided by 100 that the
transistor is HIGH. Then it compares that value to the 4 values in the
array (reference pulses), using this (in theory) the arduino should be
able to tell each pules time from another and thus be able to move
separate motors respective to the pulse value it received.
The calibration process works great. When I go into the main part of
the program is where I'm having the problem. This is best explained in
an example: I run through the calibration process moving the joystick
up, left, down, and the right when the arduino tells me to (via LCD
screen). But when the program enters the main loop and when I move
the joystick up (or any other direction) the program doesn't do
anything. It is supposed to move the arm up if the value is within
plus or minus 10 of the reference pulse. I'm not sure if I have
explained this well. But any suggestions to get this working would be
appreciated. If you have questions I can try to explain it better.