Giter Site home page Giter Site logo

kattaliraees / nrf52-ir Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 10.0 22.01 MB

Decoding and saving carrier modulated IR signals and sending modulated IR signals using NRF52 SoCs

License: MIT License

C 98.58% Assembly 1.38% Makefile 0.01% CSS 0.03% HTML 0.01% Batchfile 0.01% Shell 0.01%
microcontroller nrf52 nrf52832 nrf51 embedded-c electronics infrared-sensors infrared

nrf52-ir's Introduction

nrf52, 51 - IR Capture/Transmitter

  • Capture IR Burst from any IR remote. Send captured or any predefined IR burst.
  • Minimal use of CPU cycles. Completely based on PPI Channels
  • This will work irrespective of the IR Protocol
  • Tested with nRF SDK v15.3 & nrf52832 custom board (IR LED + TSOP38238)
  • Required nRFX drivers PPI, Timer, LOG, Clock
  • Have to be in 64MHz HFCLK
  • Refer to the complete example project in Segger embedded studio
start_capturing(&ir_decode_task_completed);

//Capture completion callback
void ir_decode_task_completed (int number_of_bits, ir_data_t *ir_data_ptr) {
  nrf_delay_ms(5000);
  send_ir_burst(ir_data_ptr, number_of_bits, &ir_transmit_task_completed); //Sending what is received after 5 Secs
}
  
//Transmit task completed callback
void ir_transmit_task_completed (void) {
  start_capturing(&ir_decode_task_completed);
}

Sending IR Code

void send_ir_code () {

  //{{IR CARRIER ON or OFF, FOR_HOW_LONG_us}, {IR CARRIER ON or OFF, FOR_HOW_LONG_us}, ...}
  ir_data_t ir_code[] = {{1,9063}, {0,4472}, {1,541}, {0,551}, 
                         {1,538}, {0,552}, {1,537}, {0,1670}, 
                         {1,541}, {0,550}, {1,539}, {0,550}, 
                         {1,539}, {0,549}, {1,541}, {0,550}, 
                         {1,537}, {0,1670}, {1,541}, {0,550}};
  
  send_ir_burst(ir_code, sizeof(ir_code)/sizeof(ir_code[0]), &ir_transmit_task_completed);
}

Image of Schematic

nrf52-ir's People

Contributors

kattaliraees avatar

Stargazers

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

Watchers

 avatar  avatar

nrf52-ir's Issues

Master IR issue

When Iam trying to flash, im getting error as i mentioned in below, please help me in this.

In file included from ../../../main.c:30:
../../../Ir_transmitter.h:21:62: error: unknown type name 'ir_transmit_complete_task'; did you mean 'ir_decode_complete_task'?
21 | bool send_ir_burst(ir_data_t *ir_data, uint32_t pulse_count, ir_transmit_complete_task t);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| ir_decode_complete_task
../../../main.c: In function 'ir_decode_task_completed':
../../../main.c:65:5: error: implicit declaration of function 'send_ir_burst' [-Werror=implicit-function-declaration]
65 | send_ir_burst(ir_data_ptr, number_of_bits, &ir_transmit_task_completed);
| ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
../../../../../../components/toolchain/gcc/Makefile.common:272: recipe for target '_build/nrf52832_xxaa/main.c.o' failed
make: *** [_build/nrf52832_xxaa/main.c.o] Error 1

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.