Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mongoose-os-libs/ir
IR library for Mongoose OS
https://github.com/mongoose-os-libs/ir
Last synced: 21 days ago
JSON representation
IR library for Mongoose OS
- Host: GitHub
- URL: https://github.com/mongoose-os-libs/ir
- Owner: mongoose-os-libs
- License: other
- Created: 2018-01-01T16:01:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-24T13:48:29.000Z (over 1 year ago)
- Last Synced: 2024-07-31T21:51:48.867Z (4 months ago)
- Language: C
- Homepage:
- Size: 5.86 KB
- Stars: 6
- Watchers: 10
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mongoose-os - ir - IR library for Mongoose OS (Awesome Mongoose OS [![Awesome](https://awesome.re/badge.svg)](https://awesome.re) / Official Libraries)
README
# IR protocol library
## Usage
Either
### src/main.c
```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
```js
load("api_ir.js");// TSOP on pin 14, NEC protocol
let ir = IR.Receiver.NEC.create(14, function(code) {
print("IR", code);
}, null);
```