Giter VIP home page Giter VIP logo

tm1637-no-delay's Introduction

TM1637-no-delay

Arduino library for TM1637 (LED Driver) forked from avishorp/TM1637

Description

An Arduino library for 7-segment display modules based on the TM1637 chip, such as Seeed Studio's Grove 4 digit display. The TM1637 chip also has keyboard input capability, but it's not implemented in this library.

Implemented without any wait function calls (such as delayMicroseconds()). A new interface is provided to update the display without pausing your event loop. Designed to be compatible with the Mozzi Sound Library. Interface changes are italicized below for quick reference.

Hardware Connection

The display modules has two signal connection (and two power connections) which are CLK and DIO. These pins can be connected to any pair of digital pins on the Arduino. When an object is created, the pins should be configured. There is no limitation on the number of instances used concurrently (as long as each instance has a pin pair of its own)

Installation

The library is installed as any Arduino library, by copying the files into a directory on the library search path of the Arduino IDE

Usage

The library provides a single class named TM1637Display. An instance of this class provides the following functions:

  • setSegments - Set the raw value of the segments of each digit
  • showNumberDec - Display a decimal number
  • showNumberDecEx - Display a decimal number with decimal points or colon
  • setBrightness - Sets the brightness of the display
  • update - Perform one step of the current data transmission

update will return true when no data is set for transmission. After calling setSegments or either showNumber functions, update will return false until that transmission has been completed (68 times to write all 4 cells). To replicate the library default transmission speed, call update at a rate of every 100 microseconds. Being called in Mozzi's updateControl with the default CONTROL_RATE 64 (every 15625 microseconds) results in slow but usable operation. For more information on timing tolerance consult the datasheet. Please refer to TM1637Display.h for more information. Two examples are included, one using the Arduino loop function to call update and the other using Mozzi's updateControl. The Mozzi sound library (tested with version 1.0.3 but 1.1.0 should work) must be reachable by your build process for the second example.

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.