Akizuki 32x16 dot LED Matrix unit (K-03735) control library.
秋月電子の32×16ドットLEDマトリクス表示装置(K-03735)を制御するライブラリです。
バッファの内容をそのままLEDマトリクス装置に送ります。
LEDマトリクス表示装置は最大4台まで接続できるので、接続台数を必ず指定してください。(この台数でバッファのサイズを計算しています。)
行間表示は1msのdelayを入れています。パラメタで変更可能です。
このライブラリの呼び出し元は基本的にwhile()でループしてください。
初めてのライブラリなのでメンバ関数もドキュメントとかまだ最低限です。
おかしなところはぜひコメントをください。
表示例は以下ページをご覧ください。
Diff: akiledmatrix.h
- Revision:
- 10:9ce938cdeb33
- Parent:
- 1:2705be49d5e2
- Child:
- 11:392395419b14
--- a/akiledmatrix.h Sun Feb 17 14:38:20 2013 +0000 +++ b/akiledmatrix.h Sun Jun 02 16:59:52 2013 +0000 @@ -24,7 +24,7 @@ * // 9 GND * // 10 GND * - * AkiLedMatrix ledmatrix(p5, p6, p7, p8, p9, p10, 1); + * AkiLedMatrix ledmatrix(p5, p6, p7, p8, p9, p10); * * int main() { * const unsigned char buf[] = { @@ -48,7 +48,7 @@ * int delay = 1000; // dynamic time (us) * * while(1){ - * ledmatrix.display(buf, delay); + * ledmatrix.display(buf, delay, ledunit); * } * } * @endcode @@ -62,28 +62,26 @@ * @param clock CLOCK IN * @param latch LATCH IN * @param strobe STROBE IN - * @param maxledunit The number of LED units. */ AkiLedMatrix(PinName sin1, PinName sin2, PinName sin3, PinName clock, PinName latch, - PinName strobe, - const unsigned int maxledunit); + PinName strobe); /** Displays the contents of the buffer * * @param buffer Display buffer * @param delay Dynamic display delay in microseconds + * @param ledunit LED unit num * @returns * void */ - void display(const unsigned char *buffer, const unsigned int delay = 1000); + void display(const unsigned char *buffer, const unsigned int delay, const unsigned int ledunit); private: DigitalOut _sin1,_sin2,_sin3,_clock,_latch,_strobe; - unsigned int _maxledunit; }; #endif \ No newline at end of file