Git Product home page Git Product logo

ht16k33-arduino's Introduction

Fork of HT16K33 Library for Arduino

This is a quick and dirty library providing a relatively easy-to-use interface for driving the Holtek HT16K33 16×8 LED driver IC.

Quickref

The API commands are, in no particular order:

init(uint8_t i2c_addr)
specifies the I2C address of the IC
setBrightness(uint8_t b)
sets the brightness of the display (0–15)
setBlink(uint8_t)
sets the blink rate of the display (see note below)
resetOrientation()
resets the orientation of the display to the defaults
reverse()
reverses the order of the two 8×8 sub-matrices (again, see note below)
flipVertical()
flips the matrix data vertically before writing to the IC
flipHorizontal()
flips the matrix data horizontally before writing to the IC
clear()
clears the matrix completely†
setPixel(uint8_t row, uint8_t col, uint8_t onoff)
sets the state of a single pixel. onoff should be either 0 (off) or 1 (on)†
setRow(uint8_t row, uint16_t value)
sets the content of an entire row (16 bits)†
getRow(uint8_t row)
gets the content of an entire row (16 bits)†
setColumn(uint8_t col, uint8_t value)
sets the content of an entire column (8 bits)†
write()
writes the display buffer to the IC (updates the display)

† note: none of these will write anything to the IC—you will still need to call write().

Blink Rates

For various reasons, blink rates are #define-d as a set of constants:

HT16K33_BLINK_OFF
disable blinking (default)
HT16K33_BLINK_1HZ
set blink rate to 1Hz
HT16K33_BLINK_2HZ
set blink rate to 2Hz
HT16K33_BLINK_0HZ5
set blink rate to 0.5Hz

Matrix reversal

This only really makes sense if you’re using a 16×8 matrix made of two discrete 8×8 matrixes. If you’re rolling it yourself or using a single 16×8, you may as well ignore this section.

This library assumes that, if you’re using two 8×8 matrixes, you’ve wired them correctly with ROW0 on the left-hand edge of the left-most matrix, and ROW15 on the right-most edge, thus:

 0      7 8     15
+--------+--------+
|        |        |
|        |        |
|        |        |
+--------+--------+

However, just occasionally your concentration will slip and you’ll end up with something like this:

 8     15 0      7
+--------+--------+
|        |        |
|        |        |
|        |        |
+--------+--------+

Rather than having to rewire everything/rework your PCBs, you can just call reverse(), and the library will cover for you…
(no, this didn’t happen to me. I don’t know why you would think that /s)

ht16k33-arduino's People

Contributors

m-a-aniskovich avatar jonpearse avatar jh1995 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.