Hello, I've successfully (to a certain extent, save for some problems with the servos) built the $50 robot, and now I'm trying to explore different possibilities using the same board. I wanted to make a servo which responds to sound, and so I built an amplifier circuit with a microphone and connected it to the Atmega8, following the instructions here: http://tinkerlog.com/2007/05/20/cheap-sound-sensor-for-avr/
I then modified the code posted on that same website, and successfully got an LED to turn on when I clap, and then off when I clap a second time. Now I want to introduce into this code a servo, so that when I clap the first time, the servo spins in one direction, and the second time, in the other direction.
I copy-pasted some of the code from the $50 robot in order to try and create this. However, it seems that whatever value I put into the servo_left(); function (I'm only using one servo) the SPEED of the servo does not change. Instead, it seems the servo is 'on' for whatever value I put in. Even this does not seem consistent. When I first clap, the servo is on for, let's say x seconds. The second time, it's on for y seconds. Then the third time, instead of being on for x seconds (because it is on a loop) the servo seems to be on for an arbitrary amount of time. The speed of the servo in all cases seems to be fixed.
What could the problem be? If you want me to upload the code, please say so and I will.
Thanks a lot!