Yes!
DrAzzy's core was just what I need.
I have a blink program fading in and out each color just using analogWrite().
So far I don't notice any problem turning off all leds. Let's see if my original program works ok.
thanks
Yes!
DrAzzy's core was just what I need.
I have a blink program fading in and out each color just using analogWrite().
So far I don't notice any problem turning off all leds. Let's see if my original program works ok.
thanks
That's it. Success, even the interrupt driven button works ok.
Thank you very much Paul.
I wish I had a debugger to see what it's doing
DrAzzy's core has built-in serial support, so you can use Serial.print() to help with debugging. You will need a usb-serial adaptor of some kind, of course.
Yes, but the built-in soft Serial uses pins that are in use, I don't know if there's a way to use other pins. But, SoftwareSerial.h to the rescue, I was able to use the only pin I still had free (PB3) to printout debug info via a TTL 2 USB adapter I had handy.
I'm quite surprised of how easy it was (got it working in the 1st try), probably I would never thought about it without the info you provided.
So, thank you again
And here is the finished project.
With a serial debug line on pin 2. The green wire on pin 1 is an improvised reset "button", I'm 1 column short on the left of breadboard to be able to add a proper button.
As I've run out of 220ohm resistors after 6 leds I just stuffed the remaining 3 in parallel with the first ones, it worked ok too, but I wander what am I stressing here, the leds or the transistors ?
Anyway, with the pwm problem solved I'm ready to take the next challenge, to "port" this to a perforated board, I really don't believe I'm ready for it yet but, we'll see.
No, you are not stressing anything. But it's not a good idea. The two leds in parallel will share the current between them. But not perfectly equally so one may look slightly brighter than the other. The danger comes from attempting to reduce the value of the series resistor to try to get the max current. If you try that, one led will take more than the other and more than is maximum. This will cause it to slowly burn out. Once that happens, the other led then has to take all the current, way more than its max, and very quickly it burns out too. So the rule is one resistor per led.
The transistors can source 800mA each, so you are not close to stressing them.