I am mounting two lasers to servos and I want the frequency that they pulse at to be linear functions of the servos' position (I don't mean the wave frequency but a blinking frequency). The frequencies have to be distinct for each laser. I am using an uno because I happen to have one and this is my first project using it. It appears that arduinos have discrete frequencies that can be set for output. I can't imagine how to control two different frequencies using delays. Are there other options? Someone suggested using assembly to program general purpose i/o pins. My solution would be to just use two arduinos. I am open to obtaining other hardware. Any suggestions are appreciated.
Is the arduino controlling the servos the lasers are mounted on or will it need to determine the angle of the servo that is controlled by some other hardware?
If it is controlling the servos then how does it get the information on what angle to set them to?
How is the arduino expected to control the lasers? Are they low power ones that can be connected directly to arduino pins or will they need to be controlled some other way.
Thank you LaserLance, I did not know such functions existed. This might solve all my problems.
KenF, yes, the two lasers are going to be received and to tell them apart they will have different ranges of frequencies. One 8-26kHz and the other 32-50kHz. Conveniently they are covering 180 degrees and the frequencies cover a 18 kHz range. Starting at 0 degrees will be the lowest frequency, increasing by .1*position and then decreasing as it pans back.
Shpaget, I figured but I did not know how.
Riva, I plan to control each laser and its servo with the same arduino so it will know the position. I am using a loop to move the servos one degree per iteration to turn it 90degrees/s. They are just going to pan back and forth as a beacon. Using 1mW average power lasers connected to the arduino.