0

Using Metro Express/AW9523 to control an RGB LED
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Using Metro Express/AW9523 to control an RGB LED

by Airborne22 on Wed Apr 28, 2021 6:42 pm

Hi, I have recently purchased one of your AW9523 I2C Expander boards with which I hope to use it to control the colour displayed by an RGB LED. I notice that in your data sheet for this Expander that you show an RGB LED connected to an AW9523 but do not, as far as I can find, show any coding or explanation of this combination.

What I am trying to achieve is to use your Metro Express (or any Arduino (UNO or Nano) or possibly even a Pi Pico etc) to control which colour is illuminated in the RGB LED by using a 3-position rotary switch on the Digital pins (I would have liked to be able to show non-primary colours but that would be an expansion of control components which I do not wish to get into at this stage).
If you (Adafruit) are showing the AW9523 controlling an RGB LED...it is possible to obtain the coding for this arrangement so that I can modify it for the above extra functionality. Thanks

Airborne22
 
Posts: 17
Joined: Sun Apr 15, 2018 2:30 pm

Re: Using Metro Express/AW9523 to control an RGB LED

by dastels on Wed Apr 28, 2021 9:43 pm

If you are working in C++, look at the library constcurrent_demo example: https://github.com/adafruit/Adafruit_AW9523/blob/master/examples/constcurrent_demo/constcurrent_demo.ino.` That shows controlling a single LED, You would just have to use 3 pins (one each for R, G, and B).

If you're using CircuitPython, there's a similar example: https://github.com/adafruit/Adafruit_CircuitPython_AW9523/blob/main/examples/aw9523_constant_current_leds.py.

Dave

dastels
 
Posts: 6456
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.