Giter VIP home page Giter VIP logo

esp-idf-irsend's Introduction

esp-idf-irSend

M5Atom, M5Stick and M5StickC(+) have internal IR Transmitter.
You can use these as Remote control transmitter.

Software requirements

esp-idf v4.4/v5.0.

Note for esp-idf v5.0
esp-idf v5.0 gives this warning, but work.

#warning "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h"

This is because the specifications of the RMT driver have changed significantly with esp-idf v5.
Presumably, esp-idf v5.1 will completely obsolete the legacy RMT driver.

How to get IR code.

You can get IR code using esp-idf-irAnalysis.

git clone https://github.com/nopnop2002/esp-idf-irSend
cd esp-idf-irSend/esp-idf-irAnalysis/
idf.py set-target esp32
idf.py menuconfig
idf.py flash monitor

Connect the IR receiver to GPIO19.
I used the TL1838, but you can use anything as long as it is powered by 3.3V.
IR transmitter don't use.
When changing GPIO19, you can change it to any GPIO using menuconfig.

 IR Receiver (TL1838)               ESP Board
+--------------------+       +-------------------+
|                  RX+-------+GPIO19             |
|                    |       |                   |
|                 3V3+-------+3V3                |
|                    |       |                   |
|                 GND+-------+GND                |
+--------------------+       +-------------------+

Build the project and flash it to the board, then run monitor tool to view serial output.
When you press a button of the remote control, you will find there output:

I (86070) main: Scan Code  --- addr: 0xff00 cmd: 0xe718
I (86120) main: Scan Code (repeat) --- addr: 0xff00 cmd: 0xe718

addr and cmd is displayed as below:
addr: 0xff00 --> {0xff-addr} << 8 + addr
cmd: 0xe718 --> {0xff-cmd} << 8 + cmd

This shows addr as 0x00 and cmd as 0x18.

Note:
You can get only NEC format IR code using this.
You can't get other format IR code.

Setup this project.

You have to edit Display.def in font directory.
Display.def have IR code which you want to fire.
And Display.def have information text which you want to view.
After which, Build this project and flash it to board.

example of Display.def.

#This is define file for isp-idf-irSend
#Text,cmd,addr;comment
Play,0x18,0x00; cmd:0xe718 addr:0xff00
Stop,0x1C,0x00; cmd:0xe31c addr:0xff00
Next,0x5A,0x00; cmd:0xa55a addr:0xff00
Prev,0x08,0x00; cmd:0xf708 addr:0xff00

Note:
Each line terminated by semicolon.

NEC IR Code Specification

Specification is here.

esp-idf-irsend's People

Contributors

nopnop2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

esp-idf-irsend's Issues

Range question

Are you using the built-in IR led on the M5StickC? Do you get good range when sending commands? Thank you!

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.