ESP8266: HT-16k33 7 Segment I2C Test

Connection:
– NodeMCU GPIO0 -> D1 -> SCL (HT-16k33)
– NodeMCU GPIO4 -> D2 -> SDA (HT-16k33)
– NodeMCU +3.3 -> 3V3 -> VCC (HT-16k33)
– NodeMCU GND -> GND -> GND (HT-16k33)
Library:
https://github.com/adafruit/Adafruit_LED_Backpack
Arduino code:
/*************************************************** This is a library for our I2C LED Backpacks Designed specifically to work with the Adafruit LED 7-Segment backpacks ----> http://www.adafruit.com/products/881 ----> http://www.adafruit.com/products/880 ----> http://www.adafruit.com/products/879 ----> http://www.adafruit.com/products/878 These displays use I2C to communicate, 2 pins are required to interface. There are multiple selectable I2C addresses. For backpacks with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks with 3 Address Select pins: 0x70 thru 0x77 Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Limor Fried/Ladyada for Adafruit Industries. BSD license, all text above must be included in any redistribution ****************************************************/ // Enable one of these two #includes and comment out the other. // Conditional #include doesn't work due to Arduino IDE shenanigans. #include <Wire.h> // Enable this line if using Arduino Uno, Mega, etc. //#include <TinyWireM.h> // Enable this line if using Adafruit Trinket, Gemma, etc. #include "Adafruit_LEDBackpack.h" #include "Adafruit_GFX.h" Adafruit_7segment matrix = Adafruit_7segment(); void setup() { #ifndef __AVR_ATtiny85__ Serial.begin(9600); Serial.println("7 Segment Backpack Test"); #endif matrix.begin(0x70); } void loop() { // print a hex number matrix.print(0xBEEF, HEX); matrix.writeDisplay(); delay(500); // print a floating point matrix.print(12.34); matrix.writeDisplay(); delay(500); // print with print/println for (uint16_t counter = 0; counter < 9999; counter++) { matrix.println(counter); matrix.writeDisplay(); delay(10); } // method #2 - draw each digit uint16_t blinkcounter = 0; boolean drawDots = false; for (uint16_t counter = 0; counter < 9999; counter ++) { matrix.writeDigitNum(0, (counter / 1000), drawDots); matrix.writeDigitNum(1, (counter / 100) % 10, drawDots); matrix.drawColon(drawDots); matrix.writeDigitNum(3, (counter / 10) % 10, drawDots); matrix.writeDigitNum(4, counter % 10, drawDots); blinkcounter+=50; if (blinkcounter < 500) { drawDots = false; } else if (blinkcounter < 1000) { drawDots = true; } else { blinkcounter = 0; } matrix.writeDisplay(); delay(10); } }
Summary

Article Name
ESP8266: HT-16k33 7 Segment I2C Test
Description
Testing ESP8266 and Adafruit LED Backpack Library for 8x8 matrix and 7-segment LED backpacks: HT-16k33 7 Segment I2C
Author
KMtronic LTD
Publisher Name
KMtronic LTD