Shutter release remote for D3200 camera. Should work with other DSLR cameras that support ML-L3 IR remote.
Fork of HelloWorld by
Shutter release remote for D3200 camera. Should work with other DSLR cameras that support ML-L3 IR remote.
Revision 2:3af381cd3df6, committed 2013-09-07
- Comitter:
- viswesr
- Date:
- Sat Sep 07 04:36:09 2013 +0000
- Parent:
- 1:03c191369089
- Child:
- 3:2d463074991d
- Commit message:
- First version
Changed in this revision
AM_Tone.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AM_Tone.lib Sat Sep 07 04:36:09 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/HelloWorld/#03c191369089
--- a/main.cpp Sun Jan 01 20:57:57 2012 +0000 +++ b/main.cpp Sat Sep 07 04:36:09 2013 +0000 @@ -1,12 +1,66 @@ +/* IR remote for D3200 DSLR camera. Should work with other DSLR cameras that support ML-L3 remote. Implemented with mbed + based on a nice documentation of ML-L3 protocol by Michele Bighignoli (http://www.bigmike.it/ircontrol/) */ + #include "mbed.h" -DigitalOut myled(LED1); +/* P0_9 is connected to an IR LED and P1_14 to a button in Seeedstudio Arch. + Change this pin as per your platform. */ +#define LED_PIN P0_9 +#define BUTTON_PIN P1_14 + +PwmOut IRled(LED_PIN); /* Connect a suitable current limiting resistor. + For longer range, use a transistor for driving IR LED */ -int main() { +DigitalIn button(BUTTON_PIN); /* Push button to enable shutter release */ + +void shutterrelease(); + +int main() +{ + button.mode(PullDown); + IRled.period_us(26); // set PWM period for Carrier Frequency of 38.4 KHz + IRled.write(0); + while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); + if(button) { + shutterrelease(); + } } + } + +void shutterrelease() +{ + /* Shutter release command sequence */ + IRled.write(0.5); + wait_us(2000); + IRled.write(0); + wait_us(27830); + IRled.write(0.5); + wait_us(400); + IRled.write(0); + wait_us(1580); + IRled.write(0.5); + wait_us(400); + IRled.write(0); + wait_us(3580); + IRled.write(0.5); + wait_us(400); + IRled.write(0); + wait_us(63200); // Wait for 63.2ms and repeat the above sequence. + IRled.write(0.5); + wait_us(2000); + IRled.write(0); + wait_us(27830); + IRled.write(0.5); + wait_us(400); + IRled.write(0); + wait_us(1580); + IRled.write(0.5); + wait_us(400); + IRled.write(0); + wait_us(3580); + IRled.write(0.5); + wait_us(400); + IRled.write(0); +}