This repo contain some notes and code how to get live a Bendy SAO badge addon. All work was done during the Hackaday 2025 conference in Berlin Please look at https://hackaday.io/project/198408-bendy-sao for more details.
If you want to use this addon with your Hackaday 2025 badge, please look for details in our another repo.
Caution
There is neccessary to keep pins GP1 and GP2 in log1 (higher than 0.7 × VDD => approx. more than 2.1 Volts). There is internal 20-50kOhm pull-up in addon chip, so if you connect just power, it will work well. But this also means, if you connect this addon to your Hackaton 2025 badge, then you need drive these pins in you badge to log1. In case when you drive these pins to low, addon will be held in reset mode.
You can build it by (PlatformIO)[https://platformio.org] (run pio run in this directory).
You can use Python MCU programmer with any USB to UART converter.
| UART to USB converter pin | Add-on pin |
|---|---|
| TX | GP2 |
| RX | GP1 |
By default MCU uses 20MHz clock, for compatibility with Adafruit library needs to be switched to 16MHz. Be carefull, this can destroy your addon (if you do something wrong, you can lose access to programming interface). You can find details in Atmel's datasheet.
pymcuprog write -d attiny3224 -t uart -u /dev/usbdevice -m fuses -o 2 -l 0x7D
pymcuprog write -d attiny3224 -t uart -u /dev/usbdevice -f ./.pio/build/attiny3224/firmware.hex --erase --verify
I2C address is hardcoded to 0x2c
| name | address |
|---|---|
| get status | 0x00 |
| get/set_mode | 0x01 |
| set led collor | 0x02 |
| chop reset | 0x05 |
| name | code |
|---|---|
| ok | 0x00 |
| message to short | 0xa0 |
| message to long | 0xa1 |
| invalid data | 0x10 |
| unknown command | 0xf0 |
taken from BendySAO's repository
| name | code |
|---|---|
| none | 0 |
| color wipe | 1 |
| theater chase | 2 |
| rainbow | 3 |
| rainbow cycle | 4 |
| theater chase rainbow | 5 |
0
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
| Mode ID |
+-+-+-+-+-+-+-+-+
0 1
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Vers. | Reser.| Error Id |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Led position id can be from 0 to 11
0 1
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LED pos. id | Red |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Green | Blue |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... for those who rule over the serpent's language ...
microPython I2C lib. doc. here
i2c1.writeto_mem(0x2c, 0x01, b'\x02')
. or .
i2c1.writeto_mem(0x2c, 0x01, b'\x04')
This will disable animation
i2c1.writeto_mem(0x2c, 0x02, b'\x01\xf0\xf0\xf0')
i2c1.readfrom_mem(0x2c, 0x01, 1)
i2c1.readfrom_mem(0x2c, 0x00, 2)
