Setting up Arduino Mega to 16Bit resolution

Hey there! Just a short question - and believe me, I have tried to find the info anywhere before posting here. I need the Arduino Mega PWM Output to not act at 8Bit width but at 10 or more. Background: I am using the Arduino to control my fish tank. For the lighting a friend (Master Degree in E-Tech) made me a driver that "amplifies" my PWM input for powering the LEDs. Problem is when dimming the LEDs down at very low light you actually see the dimming steps. No good - my fish don't like it :) Anyone who can post me a short setup sketch - I'd be very thankful!

Sme

Seen this? http://forum.arduino.cc/index.php?topic=41964.0

It was the top hit on a google search so I guess it was well hidden.

A few down was this one:- http://www.ofrecordings.com/2014/03/16/how-to-set-up-16-bit-pwm-with-an-arduino-uno-atmega328/

You could also use the Adafruit PCA9685 breakout board. 16 channels of 12bit PWM. Control 16 individual LEDs, or groups of LEDs, or more boards, with a two wire I2C interface. Wake up with an orange morning glow, or dine under cool white moon light. Your fish would probably like that... Leo..

Hello all,

@Grumpy: Belive me, I read all that. There is more to find then the link you postet, but I tried all and it made no sense to me. I am active in a lot of forums helping people with all sorts of stuff - stuff that I am good at. This - for instance is not one of them. I wish someone could just post me a sketch that I can load on to my Mega that works. I will be able to figure the rest out by myself. I will try the sketch you found on the net, I actually did not know about that one - hope it works :)

@WaWa: Yes, that is probably the way I will opt to go. It just bugs me that my Mega can do all I need and anyway I have to buy a addition...

Sme1986: I am using the Arduino to control my fish tank. For the lighting a friend (Master Degree in E-Tech) made me a driver that "amplifies" my PWM input for powering the LEDs. Problem is when dimming the LEDs down at very low light you actually see the dimming steps. No good - my fish don't like it :)

Eventually your friend can make the output exponential, with smaller steps towards zero?

DrDiettrich: Eventually your friend can make the output exponential, with smaller steps towards zero?

With Arduino's standard 8-bit PWM, the first few steps are clearly visable. Even with 12-bit PWM, the two or three lowest steps are visable. You can just ignore them, and start from 5 or 10. Exponential (CIE) lighting works by taking bigger steps in the upper region. Simple example: 0, 1, 2, 3, 4, 6, 8, 12, 16, 23, 32, 45, 64, 90, 128, 180, 255. Leo..