GithubHelp home page GithubHelp logo

ae7seg's Introduction

ae7seg

English version is here.

秋月電子の 7セグメントLEDシリアルドライバモジュール AE-7SEG-BOARD のためのライブラリです。

ドット表示、複数桁、SPI または GPIO による接続に対応しています。

特徴

  • シフトレジスタ 74595 を使った7セグLEDの制御
  • ドット表示対応
  • 任意のセグメントの表示に対応
  • 複数桁対応(桁数に制限なし)
  • SPI または GPIO による接続に対応 (SDI, SCKピンを任意に指定可)

使用方法

ライブラリをインストール後、 ae7seg.h をインクルードしてください。

#include <ae7seg.h>

その後、 AE7SEGSPI または AE7SEGGPIO を宣言し、Latchピンの番号を指定してください。

// use SPI
AE7SEGSPI ae7seg(PIN_LATCH);

// ...or use GPIO
AE7SEGGPIO ae7seg(PIN_LATCH, PIN_SDI, PIN_SCK);

一桁表示させる際は、writeNumber(number) 関数を beginWrite()endWrite() で囲って呼んでください。

ae7seg.beginWrite();
ae7seg.writeNumber(7);  // to display "7"
ae7seg.endWrite();

複数桁表示させる際は、writeNumber(number) を必要な桁の数だけ呼んでください。

ae7seg.beginWrite();
ae7seg.writeNumber(4);  // the most significant digit = "4"
ae7seg.writeNumber(2);
ae7seg.endWrite();

ドットを表示させる際は、writeNumber(number, true) を呼んでください。

ae7seg.beginWrite();
ae7seg.writeNumber(4, true);  // display a dot segment
ae7seg.writeNumber(2);        // not display implicitly
ae7seg.endWrite();

任意のセグメントを表示させる際は、writeNumber(number) の代わりに writeDigit(digit) を呼んでください。

ae7seg.beginWrite();
ae7seg.writeDigit(0b01101110);  // "H"
ae7seg.endWrite();

ライセンス

MIT License

ae7seg's People

Contributors

nanase avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.