Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface NTPClient mbed-rtos mbed
LedPanel/LedPanel.h@0:7d6abca457ee, 2015-12-23 (annotated)
- Committer:
- mbed_Cookbook_SE
- Date:
- Wed Dec 23 16:17:01 2015 +0000
- Revision:
- 0:7d6abca457ee
??
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mbed_Cookbook_SE | 0:7d6abca457ee | 1 | /** |
| mbed_Cookbook_SE | 0:7d6abca457ee | 2 | * Matrix16x16 LEDPanel library |
| mbed_Cookbook_SE | 0:7d6abca457ee | 3 | * |
| mbed_Cookbook_SE | 0:7d6abca457ee | 4 | * @author Junichi Katsu |
| mbed_Cookbook_SE | 0:7d6abca457ee | 5 | * @version 1.0 |
| mbed_Cookbook_SE | 0:7d6abca457ee | 6 | * @date 15-April-2015 |
| mbed_Cookbook_SE | 0:7d6abca457ee | 7 | * |
| mbed_Cookbook_SE | 0:7d6abca457ee | 8 | */ |
| mbed_Cookbook_SE | 0:7d6abca457ee | 9 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 10 | #ifndef MBED_LEDPANEL_H |
| mbed_Cookbook_SE | 0:7d6abca457ee | 11 | #define MBED_LEDPANEL_H |
| mbed_Cookbook_SE | 0:7d6abca457ee | 12 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 13 | #include "mbed.h" |
| mbed_Cookbook_SE | 0:7d6abca457ee | 14 | #include "LedPanel_GFX.h" |
| mbed_Cookbook_SE | 0:7d6abca457ee | 15 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 16 | #define HT16K33_BLINK_CMD 0x80 |
| mbed_Cookbook_SE | 0:7d6abca457ee | 17 | #define HT16K33_BLINK_DISPLAYON 0x01 |
| mbed_Cookbook_SE | 0:7d6abca457ee | 18 | #define HT16K33_BLINK_OFF 0 |
| mbed_Cookbook_SE | 0:7d6abca457ee | 19 | #define HT16K33_BLINK_2HZ 1 |
| mbed_Cookbook_SE | 0:7d6abca457ee | 20 | #define HT16K33_BLINK_1HZ 2 |
| mbed_Cookbook_SE | 0:7d6abca457ee | 21 | #define HT16K33_BLINK_HALFHZ 3 |
| mbed_Cookbook_SE | 0:7d6abca457ee | 22 | #define HT16K33_CMD_BRIGHTNESS 0x0E |
| mbed_Cookbook_SE | 0:7d6abca457ee | 23 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 24 | /** LedMatrix8x8Driver class |
| mbed_Cookbook_SE | 0:7d6abca457ee | 25 | * @endcode |
| mbed_Cookbook_SE | 0:7d6abca457ee | 26 | */ |
| mbed_Cookbook_SE | 0:7d6abca457ee | 27 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 28 | class LedPanel : public LedPanel_GFX |
| mbed_Cookbook_SE | 0:7d6abca457ee | 29 | { |
| mbed_Cookbook_SE | 0:7d6abca457ee | 30 | public: |
| mbed_Cookbook_SE | 0:7d6abca457ee | 31 | /** Create a LedPanel instance |
| mbed_Cookbook_SE | 0:7d6abca457ee | 32 | * |
| mbed_Cookbook_SE | 0:7d6abca457ee | 33 | * @param I2C |
| mbed_Cookbook_SE | 0:7d6abca457ee | 34 | */ |
| mbed_Cookbook_SE | 0:7d6abca457ee | 35 | LedPanel(I2C *i2c); |
| mbed_Cookbook_SE | 0:7d6abca457ee | 36 | void begin(uint8_t _addr0,uint8_t _addr1); |
| mbed_Cookbook_SE | 0:7d6abca457ee | 37 | void setBrightness(uint8_t b); |
| mbed_Cookbook_SE | 0:7d6abca457ee | 38 | void blinkRate(uint8_t b); |
| mbed_Cookbook_SE | 0:7d6abca457ee | 39 | void writeDisplay(void); |
| mbed_Cookbook_SE | 0:7d6abca457ee | 40 | void clear(void); |
| mbed_Cookbook_SE | 0:7d6abca457ee | 41 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 42 | uint16_t displaybuffer[16]; |
| mbed_Cookbook_SE | 0:7d6abca457ee | 43 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 44 | void init(uint8_t a); |
| mbed_Cookbook_SE | 0:7d6abca457ee | 45 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 46 | virtual void drawPixel(int16_t x, int16_t y, uint16_t color); |
| mbed_Cookbook_SE | 0:7d6abca457ee | 47 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 48 | void Scroll(int16_t x, int16_t y); |
| mbed_Cookbook_SE | 0:7d6abca457ee | 49 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 50 | private: |
| mbed_Cookbook_SE | 0:7d6abca457ee | 51 | I2C *_i2c; |
| mbed_Cookbook_SE | 0:7d6abca457ee | 52 | uint8_t i2c_addr[2]; |
| mbed_Cookbook_SE | 0:7d6abca457ee | 53 | }; |
| mbed_Cookbook_SE | 0:7d6abca457ee | 54 | |
| mbed_Cookbook_SE | 0:7d6abca457ee | 55 | #endif // MBED_LEDPANEL_H |