How to Radar Sweep 13 arrays of LEDs with Fade (PWM) Mega2560

Looking for starting advice on project, overall view is a circular array made up of 13 "spokes" of 3-LED array. Overall visual effect is to have it continuously sweep through in a circular motion, having all of the LED's on DIM all of the time and 1 or 2 'spokes' go to full brightness sequencing around, similar to old style radar screen with the sweeping lines. Have the Mega, have located all of the pwm dig pins, can assign the pwm values to them for the static 'on dim' phase but do not know how to proceed with making the 'sweep' happen. Have not done arduino programming before but am fast learner, have programmed other devices. Have browsed for example code, not looking for knight rider but similar with a ramp-up and ramp-down effect (the circular is just like a repeating linear bar). Any advice on if there is already code out there to mod? If not, a snippet would be appreciated greatly.
thanks!!

So the 3 LEDs are all wired together (in series or parallel) and you only need 13 dimmable outputs, right? i.e. You don't intend to wire the LEDs in as an X-Y array/matrix, right?

That shouldn't be too hard, but I doubt you are going to find existing code...

Have not done arduino programming before but am fast learner, have programmed other devices.

If you haven't done so already, I'd suggest you start by looking at the [u]Language Reference[/u] and [u]blinking & dimming examples[/u].

Then, I'd write some code to make the LEDs blink and then sequence. Once you've got a basic chase-light effect working, you can add the dimming/fading.

With nested loops, I suspect your sketch can be fairly short.

In addition to above suggestions....you may want to take a look at some "Arduino LED Bargraph" tutorials/examples. I imagine the coding should be very similar — use of arrays,for loops, etc...— you'll just have 13 "bars" instead of ten.

Here's just one to get started
http://learn.parallax.com/led-bar-graph-arduino-demo

EDIT :
And/or you could investigate how he did this...

I've done what you're trying to do, even if it takes a different form.
It uses Port Manipulation though I'm not sure how the Duemil/Uno "translates" to Mega that way.

http://forum.arduino.cc/index.php?PHPSESSID=akbdk212mmlb8hm2chn2hisn35&topic=171567.0

Outstanding! Brilliantly simple.
Thanks for sharing.

Thanks for your input. I am trying the port mod and will let you know how that ends up working, need to play with it to modify to have All of the LEDs on All of the time at lower output (number of calls). I will also pursue trying the other method and simply setting all the outputs to (128-200) range and then ramping small arrays up to full, see what visual effect looks better to the human eye. Eventually this will be translated to FET outputs or at least transistor outputs as the final version will require 12 V operation due to series wiring of the small arrays. That part I can deal with. Appreciate your help and will report back *(soon I hope) with some results and (sloppy) code.

Was able to get pretty good results with digital PWM pins with a couple of loops with ramp ups combining Fade and 'pre-brightening' of the leading and trailing sets of LED's, similar to the modified KnightRider code, combined and hacked. Question for Runaway Pancake--tried the Port Manipulation code and my Mega is just looking at me, am not sure if there is a different command set but am trying to figure it out. Anyone know if this code would work on a Pro-Mini?? that may be my final unit for use on this display. Code is from here: thanks to Runaway Pancake, see earlier in forum post.

http://forum.arduino.cc/index.php?PHPSESSID=akbdk212mmlb8hm2chn2hisn35&topic=171567.0

I would like to get this running but don't know board wise why it does not do anything on the mega...

Much appreciated!

EHein:
Was able to get pretty good results with digital PWM pins with a couple of loops with ramp ups combining Fade and 'pre-brightening' of the leading and trailing sets of LED's, similar to the modified KnightRider code, combined and hacked. Question for Runaway Pancake--tried the Port Manipulation code and my Mega is just looking at me, am not sure if there is a different command set but am trying to figure it out. Anyone know if this code would work on a Pro-Mini?? that may be my final unit for use on this display. Code is from here: thanks to Runaway Pancake, see earlier in forum post.

http://forum.arduino.cc/index.php?PHPSESSID=akbdk212mmlb8hm2chn2hisn35&topic=171567.0

I would like to get this running but don't know board wise why it does not do anything on the mega...

Much appreciated!

Which pins are you trying to use on the Mega?
That code uses portD & portB. The pins/ports are different on Mega than on UNO.

This may help...?
http://arduino.cc/en/Hacking/PinMapping2560

AAAH.. Forgive me, rookie mistake. Where the PortD pins are on the other units (digital 0-7) is PortE on the Mega. With your schematic I have located the proper ports (up in the 40's and 50's on this monster) and all is well. I did need to modify code for pin array in Setup portion and will play until I get desired. Nice writing in parallel, give many options for 'sweep' and 'wave' effects. Once I get final board done with 'real' components will post a link to video and code with modifications and credits. Thanks to all. Been doing this less than a week and I am hooked....

OK, Great.
I saw this at work but the site was down or something, probably their bad, but it in the meantime you saw the light.
You're real-time, now, and that's a good thing.
[If I wrote it with digitalWrites then it would be "transportable", but it wouldn't work so hot as there's a lot of code-overhead with that that bogs things down.]
It's definitely Pro-Mini compatible, but some adjustments to Mega are needed (which you've grasped.)

OK... Right On.
Keep us all appraised of your progress, and if you make improvements please post same.