Difference between revisions of "Time-lapse Photography"
From Microduino Wiki
(→Preparation) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 18: | Line 18: | ||
|} | |} | ||
+ | ===Preparation=== | ||
+ | *Setup 1: Connect the interface of the IR-Emitter to the D6 port of the Hub. (Note: The pin connection cannot be changed.) | ||
+ | [[file:mCookie-IR transmitter-sensor.JPG|600px|center]] | ||
+ | *Setup 2: Stack the CoreUSB, Hub and IR-Emitter together and them connect them to a computer with a USB cable. | ||
+ | [[file:mCookie-IR transmitter-pc.JPG|600px|center]] | ||
+ | ===Debugging=== | ||
+ | *Open Arduino IDE and copy the following code into IDE. | ||
+ | <source lang="cpp"> | ||
+ | #include <IRremote.h> | ||
− | + | #define PHOTO 0xB4B8F | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | IRsend irsend; | |
− | + | void setup() { | |
+ | Serial.begin(115200); | ||
+ | pinMode(6, OUTPUT); | ||
+ | } | ||
− | + | void loop() { | |
+ | for (int i = 0; i < 3; i++) | ||
+ | { | ||
+ | irsend.sendSony(PHOTO, 20); // Sony code | ||
+ | delay(12); | ||
+ | } | ||
+ | delay(5000); | ||
+ | } | ||
+ | </source> | ||
+ | *Select the right board and COM port, compile and download directly. | ||
+ | [[file:upload.JPG|400px|center]] | ||
+ | *Turn on the camera and change to remote control mode. | ||
+ | [[file:sony-photo.JPG|400px|center]] | ||
+ | *Aim the IR Emitter to the camera and send signal every 5s. You can see the LED indicator on the IR Emitter flashes and hear the picture-taking sound at the same time. | ||
+ | *It's wonderful to make the time-lapse pictures into GIF. | ||
+ | [[file:gif-photo.gif|400px|center]] | ||
===Program Debugging=== | ===Program Debugging=== | ||
*Adopt " IRremote " infrared library to support the sending and receiving of the infrared signals. | *Adopt " IRremote " infrared library to support the sending and receiving of the infrared signals. | ||
*"#define PHOTO 0xB4B8F" Define this SONY camera's infrared signal value. | *"#define PHOTO 0xB4B8F" Define this SONY camera's infrared signal value. | ||
− | *Change the delay time; "delay(5000)" means five seconds. | + | *Change the delay time; "delay(5000)" means five seconds. |
− | |||
==Experiment Two: Key Control Picture-taking == | ==Experiment Two: Key Control Picture-taking == | ||
− | + | ===Equipment=== | |
− | + | {|class="wikitable" | |
− | + | |- | |
− | + | |Module||Number||Function | |
− | + | |- | |
− | + | |[[mCookie-CoreUSB]]||1||Core board | |
− | + | |- | |
− | + | |[[mCookie-Hub]]||1||Sensor pinboard | |
− | + | |- | |
− | + | | [[Microduino-IR Emitter]]||1||Infrared emission sensor | |
− | + | |- | |
− | + | | [[Microduino-Crash]]||1||Crash sensor | |
− | + | |} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | . | + | [[File:IR_Crash.jpg|600px|center|thumb]] |
− | |||
===Hardware Buildup=== | ===Hardware Buildup=== |
Latest revision as of 23:37, 8 March 2017
Language: | English • 中文 |
---|
ContentsObjectiveHere we use the Microduino-IR Emitter to send infrared signal in the delayed time so as to control a SONY camera for picture taking and achieve time-lapse photography. Experiment One: System sends signal in the delayed timeEquipment
Preparation
Debugging
#include <IRremote.h>
#define PHOTO 0xB4B8F
IRsend irsend;
void setup() {
Serial.begin(115200);
pinMode(6, OUTPUT);
}
void loop() {
for (int i = 0; i < 3; i++)
{
irsend.sendSony(PHOTO, 20); // Sony code
delay(12);
}
delay(5000);
}
Program Debugging
Experiment Two: Key Control Picture-takingEquipment
Hardware Buildup
Software Debugging
#include <IRremote.h>
#define PHOTO 0xB4B8F
IRsend irsend;
#define pushButton 8
int buttonState, num;
void setup() {
Serial.begin(115200);
pinMode(6, OUTPUT);
pinMode(pushButton, INPUT);
}
void loop() {
buttonState = digitalRead(pushButton);
if (num != buttonState)
{
num = buttonState;
if (num == 0)
{
take();
Serial.println("take");
}
}
}
void take()
{
for (int i = 0; i < 3; i++)
{
irsend.sendSony(PHOTO, 20); // Sony code
delay(12);
}
}
You can target the IR Emitter to the camera's infrared receiver, then set the camera to remote control mode, press the key and button and the camera takes picture once. Program Description
buttonState = digitalRead(pushButton);
if (num != buttonState)
{
num = buttonState;
if (num == 0)
{
take();
Serial.println("take");
}
}
Video |