I have a 3x3 rgb matrix with common anode and I want to control each individual led in it using pwm. Which would be the easiest way of doing that using the atmega16?
You’re probably not the first person wanting to do this, so have you done some Googling to get some ideas?
I did look around a bit. I found this: https://github.com/elcojacobs/Sh... the problem is that I am using codevisionavr and that library is written for arduino. I am thinking that since I only have a 3x3 matrix maybe I could somehow use the 2 hardware pwm pins?
Replace the 3 x 3 LEDs with WS2812 Integrated Light Source modules (or NeoPixels in Adafruit parlance). Nine WS2812 modules will cost a few dollars on eBay.
Link here for a purchase of bulk WS2812 modules:https://www.ebay.com/itm/50-1000...
Now you can program the color and level of each of the 3 x 3 LED modules using a single line out pin on the ATmega16. See the Adafruit NeoPixel library for source code for using assembler embedded into C++ for internal clock speed of the Mega16, which is 8 MHz, I believe.
This is the fastest and most efficient way to control the color and intensity of 9 RGB LED modules with an ATMega16.
I use these:
Super easy to use. There is a breakout board from adafruit as well:
Super easy to use.
Thats a great deal on the Neopixels! Gonna keep that one in mind
If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman
Please Read: Code-of-Conduct
Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user
© 2018 Microchip Technology Inc.