mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.3.6 HT16K33
This commit is contained in:
parent
56515b4375
commit
a50bea6e61
@ -1,3 +1,18 @@
|
||||
platforms:
|
||||
rpipico:
|
||||
board: rp2040:rp2040:rpipico
|
||||
package: rp2040:rp2040
|
||||
gcc:
|
||||
features:
|
||||
defines:
|
||||
- ARDUINO_ARCH_RP2040
|
||||
warnings:
|
||||
flags:
|
||||
|
||||
packages:
|
||||
rp2040:rp2040:
|
||||
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
|
||||
|
||||
compile:
|
||||
# Choosing to run compilation tests on 2 different Arduino platforms
|
||||
platforms:
|
||||
@ -9,3 +24,6 @@ compile:
|
||||
- esp32
|
||||
# - esp8266
|
||||
# - mega2560
|
||||
- rpipico
|
||||
libraries:
|
||||
- "printHelpers"
|
||||
|
80
libraries/HT16K33/CHANGELOG.md
Normal file
80
libraries/HT16K33/CHANGELOG.md
Normal file
@ -0,0 +1,80 @@
|
||||
# Change Log HT16K33
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.3.6] - 2022-11-09
|
||||
- add changelog.md
|
||||
- add rp2040 to build-CI
|
||||
- update readme.md
|
||||
|
||||
|
||||
## [0.3.5] - 2022-09-23
|
||||
- fix #21 additional LEDs on the display
|
||||
used in a special layout :88:8'8
|
||||
|
||||
## [0.3.4] - 2021-12-19
|
||||
- update library.json
|
||||
- update license
|
||||
- minor edits
|
||||
|
||||
## [0.3.3] - 2021-05-26
|
||||
- fix #17 add leadingZero flag in displayTIme() (Kudos to OwenDuffy)
|
||||
|
||||
## [0.3.2] - 2021-01-14
|
||||
- add WireN support,
|
||||
- add refresh(), // experimental
|
||||
- add getOverflow(); // experimental
|
||||
- add displayFloat(f, decimals); // experimental
|
||||
|
||||
## [0.3.1] - 2020-12-28
|
||||
- Arduino-CI, unit test (framework only)
|
||||
|
||||
## [0.3.0] - 2020-10-12
|
||||
- negative float
|
||||
- cache control
|
||||
- extend displayRaw()
|
||||
|
||||
----
|
||||
|
||||
## [0.2.4] - 2020-10-10
|
||||
- refactor #5 setDigits() iso suppressLeadingZeroPlaces()
|
||||
|
||||
## [0.2.3] - 2020-10-09
|
||||
- issue #4 add negative values for displayInt()
|
||||
|
||||
## [0.2.2] - 2020-10-04
|
||||
- add displayDate() thanks to bepitama
|
||||
|
||||
## [0.2.1] - 2020-07-15
|
||||
- fix #160 - decimal point
|
||||
## [0.2.0] - 2020-06-13
|
||||
- ESP32 support
|
||||
- fix brightness bug
|
||||
|
||||
----
|
||||
|
||||
## [0.1.5] - 2019-11-30
|
||||
- refactor
|
||||
|
||||
## [0.1.4] - 2019-11-28
|
||||
- add displayRaw()
|
||||
- add displayVULeft(), displayVURight()
|
||||
|
||||
## [0.1.3] - 2019-10-07
|
||||
- fix clear
|
||||
- add suppressLeadingZeroPlaces()
|
||||
|
||||
## [0.1.2] - 2019-02-11
|
||||
-- optimized performance
|
||||
|
||||
## [0.1.1] - 2019-02-07
|
||||
- first stable version
|
||||
|
||||
## [0.1.0] - 2019-02-07
|
||||
- initial version
|
||||
|
||||
|
@ -1,48 +1,25 @@
|
||||
//
|
||||
// FILE: HT16K33.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.3.5
|
||||
// VERSION: 0.3.6
|
||||
// DATE: 2019-02-07
|
||||
// PURPOSE: Arduino Library for HT16K33 4x7segment display
|
||||
// URL: https://github.com/RobTillaart/HT16K33
|
||||
//
|
||||
// HISTORY:
|
||||
// 0.1.0 2019-02-07 initial version
|
||||
// 0.1.1 2019-02-07 first stable version
|
||||
// 0.1.2 2019-02-11 optimized performance
|
||||
// 0.1.3 2019-10-07 fixed clear, added suppressLeadingZeroPlaces();
|
||||
// 0.1.4 2019-11-28 added displayRaw(), displayVULeft(), displayVURight()
|
||||
// 0.1.5 2019-11-30 refactor,
|
||||
//
|
||||
// 0.2.0 2020-06-13 ESP32 support; fix brightness bug;
|
||||
// 0.2.1 2020-07-15 fix #160 - decimal point
|
||||
// 0.2.2 2020-10-04 added displayDate() thanks to bepitama
|
||||
// 0.2.3 2020-10-09 issue #4 add negative values for displayInt()
|
||||
// 0.2.4 2020-10-10 refactor #5 setDigits() iso suppressLeadingZeroPlaces()
|
||||
//
|
||||
// 0.3.0 2020-10-12 negative float, cache control, extend displayRaw()
|
||||
// 0.3.1 2020-12-28 Arduino-CI, unit test (framework only),
|
||||
// 0.3.2 2021-01-14 add WireN support,
|
||||
// add refresh(), // experimental
|
||||
// add getOverflow(); // experimental
|
||||
// add displayFloat(f, decimals); // experimental
|
||||
// 0.3.3 2021-05-26 fix #17 add leadingZero flag in displayTIme() [Kudos to OwenDuffy]
|
||||
// 0.3.4 2021-12-19 update library.json, license, minor edits
|
||||
// 0.3.5 2022-09-23 fix #21 additional LEDs on the display
|
||||
// used in a special layout :88:8'8
|
||||
// HISTORY: see changelog.md
|
||||
|
||||
|
||||
#include "HT16K33.h"
|
||||
|
||||
|
||||
// Commands
|
||||
#define HT16K33_ON 0x21 // 0=off 1=on
|
||||
#define HT16K33_STANDBY 0x20 // bit xxxxxxx0
|
||||
#define HT16K33_ON 0x21 // 0=off 1=on
|
||||
#define HT16K33_STANDBY 0x20 // bit xxxxxxx0
|
||||
|
||||
|
||||
// bit pattern 1000 0xxy
|
||||
// y = display on / off
|
||||
// xx = 00=off 01=2Hz 10=1Hz 11=0.5Hz
|
||||
// bit pattern 1000 0xxy
|
||||
// y = display on / off
|
||||
// xx = 00=off 01=2Hz 10=1Hz 11=0.5Hz
|
||||
#define HT16K33_DISPLAYON 0x81
|
||||
#define HT16K33_DISPLAYOFF 0x80
|
||||
#define HT16K33_BLINKON0_5HZ 0x87
|
||||
@ -51,8 +28,8 @@
|
||||
#define HT16K33_BLINKOFF 0x81
|
||||
|
||||
|
||||
// bit pattern 1110 xxxx
|
||||
// xxxx = 0000 .. 1111 (0 - F)
|
||||
// bit pattern 1110 xxxx
|
||||
// xxxx = 0000 .. 1111 (0 - F)
|
||||
#define HT16K33_BRIGHTNESS 0xE0
|
||||
|
||||
|
||||
|
@ -2,22 +2,21 @@
|
||||
//
|
||||
// FILE: HT16K33.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.3.5
|
||||
// VERSION: 0.3.6
|
||||
// DATE: 2019-02-07
|
||||
// PURPOSE: Arduino Library for HT16K33 4x7segment display
|
||||
// http://www.adafruit.com/products/1002
|
||||
// URL: https://github.com/RobTillaart/HT16K33.git
|
||||
//
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Wire.h"
|
||||
|
||||
|
||||
#define HT16K33_LIB_VERSION (F("0.3.5"))
|
||||
#define HT16K33_LIB_VERSION (F("0.3.6"))
|
||||
|
||||
|
||||
// Characters
|
||||
// Characters
|
||||
#define HT16K33_0 0
|
||||
#define HT16K33_1 1
|
||||
#define HT16K33_2 2
|
||||
@ -52,9 +51,9 @@ public:
|
||||
|
||||
bool isConnected();
|
||||
|
||||
// default _cache is true as it is ~3x faster but if one has noise
|
||||
// on the I2C and wants to force refresh one can disable caching
|
||||
// for one or more calls.
|
||||
// default _cache is true as it is ~3x faster but if one has noise
|
||||
// on the I2C and wants to force refresh one can disable caching
|
||||
// for one or more calls.
|
||||
void clearCache();
|
||||
void cacheOn() { _cache = true; };
|
||||
void cacheOff() { _cache = false; };
|
||||
@ -67,18 +66,18 @@ public:
|
||||
void blink(uint8_t value); // 0 .. 3 0 = off
|
||||
|
||||
|
||||
// 0,1,2,3,4 digits - will replace suppressLeadingZeroPlaces
|
||||
// 0,1,2,3,4 digits - will replace suppressLeadingZeroPlaces
|
||||
void setDigits(uint8_t value);
|
||||
// 0 = off, 1,2,3,4 digits space instead of 0
|
||||
// 0 = off, 1,2,3,4 digits space instead of 0
|
||||
void suppressLeadingZeroPlaces(uint8_t value); // will be obsolete
|
||||
|
||||
void displayClear();
|
||||
bool displayInt(int n); // -999 .. 9999
|
||||
bool displayHex(uint16_t n); // 0000 .. FFFF
|
||||
|
||||
// Date could be {month.day} or {day.hour} . as separator
|
||||
// Time could be hh:mm or mm:ss or ss:uu (hundreds : as separator
|
||||
// colon displays : lz = Leading Zero or space
|
||||
// Date could be {month.day} or {day.hour} . as separator
|
||||
// Time could be hh:mm or mm:ss or ss:uu (hundreds : as separator
|
||||
// colon displays : lz = Leading Zero or space
|
||||
bool displayDate(uint8_t left, uint8_t right, bool lz = true); // 00.00 .. 99.99
|
||||
bool displayTime(uint8_t left, uint8_t right, bool colon = true, bool lz = true); // 00:00 .. 99:99
|
||||
bool displaySeconds(uint16_t seconds, bool colon = true, bool lz = true); // 00:00 .. 99:99
|
||||
@ -102,17 +101,17 @@ public:
|
||||
bool displayVURight(uint8_t value); // 0..8
|
||||
|
||||
|
||||
// DEBUG
|
||||
// DEBUG
|
||||
void displayTest(uint8_t del);
|
||||
// array as numbers
|
||||
// array as numbers
|
||||
void dumpSerial(uint8_t *array, uint8_t point);
|
||||
// display cache in HEX format
|
||||
// display cache in HEX format
|
||||
void dumpSerial();
|
||||
uint8_t getAddress() { return _address; };
|
||||
uint8_t getAddr() { return getAddress(); }; // TODO obsolete in future
|
||||
uint8_t getAddr() { return getAddress(); }; // TODO obsolete in future
|
||||
|
||||
|
||||
// EXPERIMENTAL
|
||||
// EXPERIMENTAL
|
||||
bool getOverflow() { return _overflow; };
|
||||
void clrOverflow() { _overflow = false; };
|
||||
|
||||
@ -129,14 +128,14 @@ private:
|
||||
void writePos(uint8_t pos, uint8_t mask, bool point);
|
||||
|
||||
uint8_t _address;
|
||||
uint8_t _displayCache[5]; // for performance
|
||||
uint8_t _displayCache[5]; // for performance
|
||||
bool _cache = true;
|
||||
uint8_t _digits = 0;
|
||||
uint8_t _bright;
|
||||
|
||||
TwoWire* _wire;
|
||||
|
||||
// EXPERIMENTAL
|
||||
// EXPERIMENTAL
|
||||
bool _overflow = false;
|
||||
};
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/HT16K33.git"
|
||||
},
|
||||
"version": "0.3.5",
|
||||
"version": "0.3.6",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=HT16K33
|
||||
version=0.3.5
|
||||
version=0.3.6
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino Library for HT16K33 I2C 4x7segment display
|
||||
|
Loading…
Reference in New Issue
Block a user