servo controlling led's

Dear reader,

i have a metroX with a breadboard, and i'm trying to control 8 led's with a servo. that might sound confusing, so let me clear it up. i have a potentiometer, and when i twist it, my servo goes to a certain position. i want it so when the servo gets to a certain position, a led will light up, and when it gets to the next, another one will light up(the second led), and so on to 8 led's. i got all the led's to light up, and the servo to move with the potentiometer. but how do i get them to work together?

thanks for the help,
Russell

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Post the code you have and we can advise on how to combine them.
The fact that you have the servo moving with the pot is good, you now need to associate the pot value with how many LEDs you light up.

Tom.... :slight_smile:

i want it so when the servo gets to a certain position, a led will light up,and when it gets to the next, another one will light up

As you get no positional feedback from a servo you do not know at any time where it is pointing, so what you are asking is not possible.

You could cheat and issue the command to the servo to reach a certain point and then wait long enough for the servo to arrive at that position then light up the LED. Then proceed to the next point. If you get the delays right it might even look like you want it to.

Well spotted.

But it says:-

Note that the default servo pulse widths (usually 1ms to 2ms) may not give you a full 180 degrees of motion. In that case, check if you can set your servo controller to custom pulse lengths and try 0.75ms to 2.25ms. You can try shorter/longer pulses but be aware that if you go too far you could break your servo!

So not even 180 degrees of movement. I wonder if that would solve the OP’s problem.