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.
Adafruit_LEDBackpack.h
00001 /*************************************************** 00002 This is a library for our I2C LED Backpacks 00003 00004 Designed specifically to work with the Adafruit LED Matrix backpacks 00005 ----> http://www.adafruit.com/products/ 00006 ----> http://www.adafruit.com/products/ 00007 00008 These displays use I2C to communicate, 2 pins are required to 00009 interface. There are multiple selectable I2C addresses. For backpacks 00010 with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks 00011 with 3 Address Select pins: 0x70 thru 0x77 00012 00013 Adafruit invests time and resources providing this open source code, 00014 please support Adafruit and open-source hardware by purchasing 00015 products from Adafruit! 00016 00017 Written by Limor Fried/Ladyada for Adafruit Industries. 00018 BSD license, all text above must be included in any redistribution 00019 ****************************************************/ 00020 00021 /* 00022 * Modified by Luiz Hespanha (http://www.d3.do) 8/16/2013 for use in LPC1768 00023 */ 00024 00025 #include "mbed.h" 00026 #include "Adafruit_GFX.h" 00027 #include "myi2c.h" 00028 00029 #define LED_ON 1 00030 #define LED_OFF 0 00031 00032 #define LED_RED 1 00033 #define LED_YELLOW 2 00034 #define LED_GREEN 3 00035 00036 00037 00038 #define HT16K33_BLINK_CMD 0x80 00039 #define HT16K33_BLINK_DISPLAYON 0x01 00040 #define HT16K33_BLINK_OFF 0 00041 #define HT16K33_BLINK_2HZ 1 00042 #define HT16K33_BLINK_1HZ 2 00043 #define HT16K33_BLINK_HALFHZ 3 00044 00045 #define HT16K33_CMD_BRIGHTNESS 0x0E 00046 00047 // this is the raw HT16K33 controller 00048 class Adafruit_LEDBackpack { 00049 public: 00050 Adafruit_LEDBackpack(myI2C *i2c); 00051 void begin(uint8_t _addr); 00052 void setBrightness(uint8_t b); 00053 void blinkRate(uint8_t b); 00054 void writeDisplay(void); 00055 void clear(void); 00056 00057 uint16_t displaybuffer[16]; 00058 00059 void init(uint8_t a); 00060 00061 protected: 00062 myI2C *_i2c; 00063 00064 private: 00065 uint8_t i2c_addr; 00066 }; 00067 00068 class Adafruit_8x8matrix : public Adafruit_LEDBackpack, public Adafruit_GFX { 00069 public: 00070 Adafruit_8x8matrix(myI2C *i2c); 00071 00072 virtual void drawPixel(int16_t x, int16_t y, uint16_t color); 00073 00074 private: 00075 };
Generated on Tue Jul 12 2022 20:04:42 by
