Skip to content

kelvin2go/ir

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IR protocol library

Usage

Either

src/main.c

#include "mgos.h"
#include "mgos_ir.h"

static void irrecv_cb(int code, void *arg)
{
  LOG(LL_INFO, ("IR: %08X", code));
  (void) arg;
}

enum mgos_app_init_result mgos_app_init(void)
{
  // TSOP on pin 14, NEC protocol
  mgos_irrecv_nec_create(14, irrecv_cb, NULL);

  return MGOS_APP_INIT_SUCCESS;
}

or

fs/init.js

load("api_ir.js");

// TSOP on pin 14, NEC protocol
let ir = IR.Receiver.NEC.create(14, function(code) {
    print("IR", code);
}, null);

About

IR library for Mongoose OS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 81.1%
  • JavaScript 18.9%