Giter Site home page Giter Site logo

necirdecode's Introduction

NEC Infrared Decoder library

License

A library for decoding remote control codes using the NEC IR transmission protocol for STM32duino.

Usage

To use the library, you must first construct an object of type NECIRDecode. Then you can use any of the methods displayed below.

Methods

NECIRDecode(int pin, int timer = 2)

The constructor takes one mandatory argument, which is the pin where the IR receiver is connected, and one optional argument, which is the timer number that will be used.

void init()

The init() method initializes the library. It should usually be called once in your setup() function.

void stateMachine()

The state machine engine. It should never be called directly by a user. It is a public method because it has to be called by the timer interrupt handler.

uint32_t getNext()

The getNext() method returns the next IR code received. If no code has been received, the return value is 0. If a repeat code has been received, the return value is 0xffffffff.

Example

A generic example can be found in the examples/ directory.

Notes

Due to some design issues related to calling the stateMachine() method from the timer interrupt handler, you can only create a single object of this type at every program.

The library can only hold a limited number of ir codes. If you don't handle them in time, new ones will be lost.

License

The code is licensed under the BSD 3-clause "New" or "Revised" License.

necirdecode's People

Contributors

fotisl avatar per1234 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

bigbro2014

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.