Expand your project possibilities, with the Adafruit AW9523 GPIO Expander and LED Driver Breakout - a cute and powerful I2C expander with a lot of tricks up its sleeve./使用Adafruit AW9523 GPIO擴充器和LED驅動器突破器擴展您的專案可能性 - 一個可愛而強大的I2C擴展器,具有許多技巧。。
GPIO expanders work like this: you have a board with some number of GPIO but not enough for your project - maybe you need more buttons or LEDs. You could upgrade to a board with massive number of GPIO like the Grand Central, or you could pop on one of these boards. Connect it over I2C and then you can send/receive I2C commands to control the GPIO pins to write and read them. It's going to be slower than direct GPIO access, but maybe that doesn't matter if it takes a millisecond instead of a microsecond. You only need the two I2C pins, and you can even share the I2C port with other sensors and devices. Heck, you can even add more expanders for massive I/O control!./GPIO擴充器的工作原理是這樣的:你有一個帶有一定數量的GPIO的電路板,但不足以滿足你的專案 - 也許你需要更多的按鈕或LED。您可以升級到具有大量GPIO的板,例如 Grand Central,或者您可以在其中一個板上彈出。通過 I2C 連接它,然後您可以發送/接收 I2C 命令來控制 GPIO 引腳以寫入和讀取它們。它將比直接GPIO訪問慢,但如果它需要一毫秒而不是一微秒,也許這並不重要。您只需要兩個I2C引腳,您甚至可以與其他感測器和設備共用I2C埠。哎呀,您甚至可以添加更多擴展器來實現大規模的I / O控制!。
【The AW9523 is a twist on the common I2C expander】: - First up, its very affordable - who doesn't love that?
- It has 16 I/O pins, that'll double most boards' pin count
- Four I2C address options, so you can connect 4 expanders to one bus
- Each pin can be an input or an output
- IRQ output can alert you when input pins change value
- This chip does not support internal pull-ups or pull-downs, you will need to add an external resistor if you need one
- However, it does have 8-bit linear constant-current LED dimming support so you can connect LEDs without resistors and have great looking dimming without PWM
- The first 8 pins can be configured as open drain (as a group)。
The lack of internally-configurable pull's is a bit of a bummer, but we think the expander more than makes up for it with the constant-current LED drive. If you're using an expander to add lots of controllable LEDs, this board will make it very easy. Since its constant-current, you don't need resistors in line with each LED (although it won't hurt if you do): simply connect the LED anode to one of the many VIN pads, then connect the cathode to the GPIO pin./ 缺乏內部可配置的拉力有點令人沮喪,但我們認為擴展器足以彌補恆流LED驅動器。如果您使用擴充器添加大量可控LED,該板將使其變得非常容易。由於其恆流,您不需要與每個LED對齊的電阻器(儘管這樣做不會造成傷害):只需將LED陽極連接到許多VIN焊盤之一,然後將陰極連接到GPIO引腳即可。
Of course, you can control any buttons or other I/O with the pins - we just think this board is particularly suited to LED driving. There's also an interrupt output, you can enable the pin-change IRQ for any pins so you can be notified when its time to read the I/O states./ 當然,您可以使用引腳控制任何按鈕或其他I / O - 我們只是認為該板特別適合LED驅動。還有一個中斷輸出,您可以為任何引腳啟用引腳更改IRQ,以便在讀取I / O狀態時收到通知。
One oddity about this chip is the default I2C address determines the initial boot-state of the pins. Our libraries immediately soft-reset and configure all the pins to inputs and push-pull so you can expect the same behavior no matter what the I2C address is. However, we recommend you check the datasheet Table 1 to make sure this doesn't affect your hardware. /該晶元的一個奇怪之處在於,預設的I2C位址決定了引腳的初始啟動狀態。我們的庫可立即軟複位,並將所有引腳配置為輸入和推挽,因此無論I2C位址是什麼,您都可以預期相同的行為。但是,我們建議您查看數據表 1,以確保這不會影響您的硬體。
We've written both Arduino and CircuitPython/Python libraries for the AW9523, so you can get started whether you have an Arduino-compatible UNO or a Raspberry Pi 4 - or anything in between./ 我們已經為AW9523編寫了Arduino和CircuitPython / Python庫,因此無論您擁有與Arduino兼容的UNO還是Raspberry Pi 4 - 或者介於兩者之間的任何內容,您都可以開始使用。 To get you going fast, we spun up a custom made PCB in the STEMMA QT form factor, making it easy to interface with. The STEMMA QT connectors on either side are compatible with the SparkFun Qwiic I2C connectors. This allows you to make solderless connections between your development board and the AW9523 or to chain it with a wide range of other sensors and accessories using a compatible cable. QT Cable is not included, but we have a variety in the shop.
為了讓您快速行動,我們推出了STEMMA QT外形的定製PCB,使其易於介面。兩側的STEMMA QT 連接器都與SparkFun Qwiic I2C 連接器相容。這允許您在開發板和AW9523之間建立無焊連接,或者使用相容的電纜將其與各種其他感測器和附件連結在一起。 QT電纜不包括在內,但我們在商店裡有各種各樣的電纜。