Daniil Budanov / Mbed 2 deprecated DslrIrLib

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DslrIr.h Source File

DslrIr.h

00001 /**
00002 * MBED code functionality, including idea of modulating PWM signal, taken from
00003 * https://os.mbed.com/users/viswesr/code/DSLR_Camera_IR_Remote/
00004 * As the given values did not work on the Nikon D3300, they were modified,
00005 * parameterized, and put into library form.
00006 * 
00007 * Inspiration, default values, and an Arduino validation signal were taken from
00008 * https://bayesianadventures.wordpress.com/2013/08/09/nikon-ml-l3-ir-remote-hack/
00009 *
00010 * Library instructions were taken from https://os.mbed.com/cookbook/Writing-a-Library
00011 */
00012 
00013 #ifndef DSLR_IR_H_
00014 #define DSLR_IR_H_
00015 
00016 #include "mbed.h"
00017 
00018 class DslrIr {
00019 public:
00020     DslrIr(PinName pin);
00021     void trigger();
00022  
00023 private:
00024     PwmOut _pin;
00025     
00026     const static float ACTIVE_DUTY_CYCLE = 15.0/24;
00027     const static int PWM_PERIOD = 25;    
00028     const static int SEQ_ON_1_PERIOD = 2160;
00029     const static int SEQ_OFF_1_PERIOD = 27840;
00030     const static int SEQ_ON_2_PERIOD = 550;
00031     const static int SEQ_OFF_2_PERIOD = 1550;
00032     const static int SEQ_ON_3_PERIOD = 550;
00033     const static int SEQ_OFF_3_PERIOD = 3558;
00034     const static int SEQ_ON_4_PERIOD  = 550;
00035     const static int SEQ_OFF_4_PERIOD = 63000;
00036     const static int SEQ_ON_1_PERIOD2 = 2160;
00037     const static int SEQ_OFF_1_PERIOD2 = 27850;
00038     const static int SEQ_ON_2_PERIOD2 = 530;
00039     const static int SEQ_OFF_2_PERIOD2 = 1550;
00040     const static int SEQ_ON_3_PERIOD2 = 530;
00041     const static int SEQ_OFF_3_PERIOD2 = 3550;
00042     const static int SEQ_ON_4_PERIOD2  = 530;
00043 };
00044 
00045 #endif