code help with leds in response to servo postion

Hi, I am new to Arduino, having avoided programming all my life. I work with electrics/electronics in the film/tv industry.
I am working on a prop for a tv commercial. An analogue 'VU'-meter-type scale is required to move from zero to full scale deflection (180 degrees) and as the pointer moves six Leds light up in succession (staying on). I am using an arduino uno with the 'knob' sketch to move the servo which drives the pointer. I am planning to have six comparators (two LM339 quad packages) wired up to the control potentiometer to compare the potentiometer voltage to six trimmer pot voltages on the other inputs of the comparators, which then triggers mosfets which power the high power leds.
This is obviously an un-elegant hybrid solution from someone who doesn't know programming. I am sure there must be a way to do this all in the software. I am hoping someone here can show me the way. I have had an arduino starter kit lying around for years but never had the time to learn arduino code and for years have waited for a project that requires me to learn and use it. The problem is that time is always lacking and I can always think of an analogue ( if Heath-Robinson) way of solving the problem whereas I may not get the code to work in time.
I have done a quick search of threads but I haven't found anything simillar enough. I would apreciate any help you guys can give me.

After you read the value of the pot, make 6 comparisons, and control LEDs in response....

something like this (where 'reading' is the variable you stored the analogRead() result in, and LED1 is whatever pin you have the LED on)

if (reading > 170) {
digitalWrite(LED1,1);
} else {
digitalWrite(LED1,0);
}

I am using an arduino uno with the ‘knob’ sketch to move the servo which drives the pointer.

Why not drive a real moving coil meter from a PWM output with a load resistor?
It’ll look a lot quicker and more realistic than a servo.

I'm won't attempt to write the code for you (especially since it has to be integrated with your servo code), but it's simply a matter of an [u]if-statmement[/u] for each LED, turning it on if the signal is greater than or equal to it's threshold.

If you're feeding-in real audio, you'll need to add some delay to hold the LEDs on so they don't just "flicker" with the peaks. Or, you might want to add some averaging to make it slower like a real VU meter. (But, most modern LED audio meters are peak reading with fast attack and slow delay.)

But, you'll probably want to avoid the delay() function. Your program execution will pause during the delay time, and that's undesirable in most real world programs. If that's an issue for you, look at the Blink Without Delay example.

Hi, I am new to Arduino, having avoided programming all my life. I work with electrics/electronics in the film/tv industry.

In that case, the Arduino is the perfect place to start!

Programming is NOT easy, but with the Arduino it's easy to get started with blinking LEDs and things like that.

There are two inportant concepts in programming - Conditional execution (if-statements, etc.) and loops (doing things over-and-over, usually until some condition is met). Once you understand those two concepts, you can begin to understand the big picture of how to design your program. Then, it's just a matter of filling-in the details, which is of course the hard part.

I am working on a prop for a tv commercial.

You should be able to "cheat" on the apparatus as it will only be needed for the shoot then discarded. Just like movie props, they only have to look real from the camera view.

Thank you for your responses. Very helpful.
I should have stated that there is no real audio signal,its all going to be faked. The idea is that a man (well, idiot) has invented a mask that turns shouting into electricity. The actor will be acting screaming with the mask on and the gauge and leds will be ramping up to show how much electricity is being generated. I just wanted it to be controlled by one pot, held either by the actor or someone off screen.
I will let you know how I get on.

This seems to me a typical program where there should be two parts with a common interface.

In this case the interface could be a byte array with each element representing the on/off state of an LED.

Then you would have two simple functions.

The first would read the potentiometer value and set the array values accordingly.
The other would read the array values and set the leds accordingly.

The code in loop() would be as simple as

void loop(){
   readPotentiometer();
   updateLEDs();
}

Have a look at planning and implementing a program

...R