テスト用です。

Dependencies:   mbed

Committer:
jksoft
Date:
Tue Oct 11 11:09:42 2016 +0000
Revision:
0:8468a4403fea
SB??ver;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:8468a4403fea 1 /***************************************************
jksoft 0:8468a4403fea 2 This is a library for our I2C LED Backpacks
jksoft 0:8468a4403fea 3
jksoft 0:8468a4403fea 4 Designed specifically to work with the Adafruit LED Matrix backpacks
jksoft 0:8468a4403fea 5 ----> http://www.adafruit.com/products/
jksoft 0:8468a4403fea 6 ----> http://www.adafruit.com/products/
jksoft 0:8468a4403fea 7
jksoft 0:8468a4403fea 8 These displays use I2C to communicate, 2 pins are required to
jksoft 0:8468a4403fea 9 interface. There are multiple selectable I2C addresses. For backpacks
jksoft 0:8468a4403fea 10 with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
jksoft 0:8468a4403fea 11 with 3 Address Select pins: 0x70 thru 0x77
jksoft 0:8468a4403fea 12
jksoft 0:8468a4403fea 13 Adafruit invests time and resources providing this open source code,
jksoft 0:8468a4403fea 14 please support Adafruit and open-source hardware by purchasing
jksoft 0:8468a4403fea 15 products from Adafruit!
jksoft 0:8468a4403fea 16
jksoft 0:8468a4403fea 17 Written by Limor Fried/Ladyada for Adafruit Industries.
jksoft 0:8468a4403fea 18 BSD license, all text above must be included in any redistribution
jksoft 0:8468a4403fea 19 ****************************************************/
jksoft 0:8468a4403fea 20
jksoft 0:8468a4403fea 21 /*
jksoft 0:8468a4403fea 22 * Modified by Luiz Hespanha (http://www.d3.do) 8/16/2013 for use in LPC1768
jksoft 0:8468a4403fea 23 */
jksoft 0:8468a4403fea 24
jksoft 0:8468a4403fea 25 #include "mbed.h"
jksoft 0:8468a4403fea 26 #include "Adafruit_GFX.h"
jksoft 0:8468a4403fea 27 #include "myi2c.h"
jksoft 0:8468a4403fea 28
jksoft 0:8468a4403fea 29 #define LED_ON 1
jksoft 0:8468a4403fea 30 #define LED_OFF 0
jksoft 0:8468a4403fea 31
jksoft 0:8468a4403fea 32 #define LED_RED 1
jksoft 0:8468a4403fea 33 #define LED_YELLOW 2
jksoft 0:8468a4403fea 34 #define LED_GREEN 3
jksoft 0:8468a4403fea 35
jksoft 0:8468a4403fea 36
jksoft 0:8468a4403fea 37
jksoft 0:8468a4403fea 38 #define HT16K33_BLINK_CMD 0x80
jksoft 0:8468a4403fea 39 #define HT16K33_BLINK_DISPLAYON 0x01
jksoft 0:8468a4403fea 40 #define HT16K33_BLINK_OFF 0
jksoft 0:8468a4403fea 41 #define HT16K33_BLINK_2HZ 1
jksoft 0:8468a4403fea 42 #define HT16K33_BLINK_1HZ 2
jksoft 0:8468a4403fea 43 #define HT16K33_BLINK_HALFHZ 3
jksoft 0:8468a4403fea 44
jksoft 0:8468a4403fea 45 #define HT16K33_CMD_BRIGHTNESS 0x0E
jksoft 0:8468a4403fea 46
jksoft 0:8468a4403fea 47 // this is the raw HT16K33 controller
jksoft 0:8468a4403fea 48 class Adafruit_LEDBackpack {
jksoft 0:8468a4403fea 49 public:
jksoft 0:8468a4403fea 50 Adafruit_LEDBackpack(myI2C *i2c);
jksoft 0:8468a4403fea 51 void begin(uint8_t _addr);
jksoft 0:8468a4403fea 52 void setBrightness(uint8_t b);
jksoft 0:8468a4403fea 53 void blinkRate(uint8_t b);
jksoft 0:8468a4403fea 54 void writeDisplay(void);
jksoft 0:8468a4403fea 55 void clear(void);
jksoft 0:8468a4403fea 56
jksoft 0:8468a4403fea 57 uint16_t displaybuffer[16];
jksoft 0:8468a4403fea 58
jksoft 0:8468a4403fea 59 void init(uint8_t a);
jksoft 0:8468a4403fea 60
jksoft 0:8468a4403fea 61 protected:
jksoft 0:8468a4403fea 62 myI2C *_i2c;
jksoft 0:8468a4403fea 63
jksoft 0:8468a4403fea 64 private:
jksoft 0:8468a4403fea 65 uint8_t i2c_addr;
jksoft 0:8468a4403fea 66 };
jksoft 0:8468a4403fea 67
jksoft 0:8468a4403fea 68 class Adafruit_8x8matrix : public Adafruit_LEDBackpack, public Adafruit_GFX {
jksoft 0:8468a4403fea 69 public:
jksoft 0:8468a4403fea 70 Adafruit_8x8matrix(myI2C *i2c);
jksoft 0:8468a4403fea 71
jksoft 0:8468a4403fea 72 virtual void drawPixel(int16_t x, int16_t y, uint16_t color);
jksoft 0:8468a4403fea 73
jksoft 0:8468a4403fea 74 private:
jksoft 0:8468a4403fea 75 };