I hope someone could assist me, would speed things up drastically.
Trying to use the arduino Mega to triger multiple logic level mosfets. (22 in total)
Each of these will switch on a array of LEDs on a seperate Supply.
What I want to achive is to toggle these leds on and off at high speeds to form random patters out of sync with each other.
Any help with code for this would be much appreciated.
Even just a starting point of ref would be great.
Next question is : Could I control the intensity of the leds by turning them on and of in mil. sec. to simmulate a dimming effect?
Thank you for the advice. As most of you can see I am new to Arduino.
Had a Play with the PWM fading of the leds, and works great.
Now that is exactly what I want to achive but only on a different level.
As mentioned I have 22 high voltage Led arrays. Each can be controled by a logic level mosfet. Using the Arduino I want to pulsate them exactly as per the example of the PWM only each array at a different time and speed, and delay between fading on and off.
To achive this could I use some of the digital pins to pulsate or can I only use the 12 PWM pins, Thus leaving me 10 short?
Would I have to create 22 loops with an large number of integers, can I use procedures.
Any help would be appreciated.
The problem with emulating PWM is that it takes a large amount of resources. The PWM pins do, in hardware, what you would need to do in software.
Controlling multiple pins, at different duty cycles, may exceed the abilities of the Mega to do anything else. But, maybe not. Perhaps someone else could comment.
The sole puprose of the controler would be to Pulsate the various arrays.
I tried adding multiple loops of the analogewrite comand, but it only executes one loop at a time.
Still have a lot to learn...