Hi!
I can't find in the documentation how to declare and use more than one AW9523. I've seen how to change the address with the jumper on the back of the board, but not how to set them up in code (arduino). In the example code the only place I see the address been called is in:
if (! aw.begin(0x58)) {
Serial.println("AW9523 not found? Check wiring!");
while (1) delay(10); // halt forever
}
if (! aw2.begin(0x59)) {
Serial.println("AW9523_2 not found? Check wiring!");
while (1) delay(10); // halt forever
}
Thank you for the reply. I still can't get the second AW9523 to be detected. A0 jumper is soldered and SCL,SDA,Vin and Grd are connected just like the first AW9523.
Yes, it locks at "AW9523_2 not found". I connected the second one with test hook clips. I’m using a Teensy 4.0. First one have headers.
Teensy pin 18 to SDA (AW9523_0 and AW9523_2)
Teensy pin 19 to SCL (AW9523_0 and AW9523_2)
Teensy 3v to Vin (AW9523_0 and AW9523_2)
Teensy Gnd to Gnd (AW9523_0 and AW9523_2)
Yeah, you were right, connection reliability was the issue. I was able to get the code running and connect to both AW9523s. Thank you again for the support!
Another question related to using multiple AW9523. For my project, I’m planning on using 4 AW9523 to run 8 Leds and 8 button on each board. I’m concerned about powering those from the microcontroller (Teensy 4.0) 3.3v(250mA max) pin. Is it safe to do so? I’ve test 2 boards and it was running just fine, but I don’t want to damage the teensy or the AW9523 boards. I will power the project with a lipo battery or 3xAA batteries.
Thank you
The AW9323 gives you the ability to control the current through each LED, so you can keep it low... how low depends on how bright you need them. But you'll probably need to power them separately from the Teensy.
I'd start by figuring out how much current you need for the LEDs and scale that up by the number of LEDs you need (32, I believe). You won't necessarily need multiple batteries, but possibly just multiple regulators.
So assuming that the leds have a forward current of 20mA, for the worst case scenario with all leds at full brightness (255) 20mA x 32=640mA. I was planning to reduce brightness by a little less than half (60%) so (20x0.60)x32=384mA.
I’m not too familiar with regulators. Should one for the teensy and one for the 4 AW9523 is enough, assuming it can output at least 384mA? Like this one https://www.adafruit.com/product/2165.
That regulator will give up up to 800mA and will be fine for the LEDs. You'll also need to supply the regulator with the amount of current you want to get out of it.