LEDマトリクスボードとM5StackはGroveケーブルで接続し制御しています。LEDマトリクスボードはHT16K33A(LEDマトリクスドライバ)を搭載していて、通信インターフェイスはI2Cです。
The LED matrix board and the M5Stack are connected and controlled via a Grove cable. The LED matrix board is equipped with an HT16K33A (LED matrix driver), and the communication interface is I2C.
プログラムはArduino言語を使用し、Arduino IDEでM5Stackに書き込んでいます。HT16K33Aを制御するためのライブラリはありましたが、8×16のLED全てを制御出来るライブラリは無かったので、ライブラリを使用せずに頑張ることにしました。
I used the Arduino language for programming and wrote the code to the M5Stack using the Arduino IDE. Although there was a library available to control the HT16K33A, there wasn't one that could control all 8x16 LEDs. Therefore, I decided to manage without a library and do it on my own.
文字やグラフィックをLEDマトリクスボードに表示するのは少々大変です。どの位置のLEDを光らせれば良いのかを考えてコマンドを書き起こし、HT16K33AにコマンドをI2Cで送信する必要があります。そこで専用のコマンド生成ツールをHTMLとJavascriptで作りました。 例えば数字の1を表示したいときは、ツールのボタンをポチポチ押していき、"execute"ボタンを押すと対応したコマンドが出力されます。
Displaying text and graphics on the LED matrix board is somewhat challenging. I need to figure out which LEDs to light up, write the corresponding commands, and send those commands to the HT16K33A via I2C. To make this easier, I created a dedicated command generation tool using HTML and JavaScript. For example, if I want to display the number '1', I press the buttons on the tool and then click the 'execute' button to generate the corresponding commands.
専用ツールで出力したコマンドをArduino言語で作った制御プログラムに書き込み、I2CでHT16K33Aに送信します。
I write the commands generated by the dedicated tool into the control program created with the Arduino language and send them to the HT16K33A via I2C.
以下はLEDマトリクスボードの回路図です。
Here is the circuit diagram of the LED matrix board.