Here is what I got. The pictures in the video was taken every 5 sec at day and every 3 sec at night.
Step 1: Prepare Your Electronics.
I used Me-Baseboard as my main control. I used the Infrared remote controller and infrared receiver to remote control my camera. They came with the starter kit from Makeblock. The electronic on the second picture is Me-shutter, which translates the micro-controller command to the language camera can understand. The main part of this auto photographing system is in the coding part.
The Me-shutter goes to PORT 3 and the Me-Infrared receiver goes to PORT 6 as indicated in my code.
Step 2: How to Modify Your Own Auto Photographing System.
Here is the code I made for IR remote control.
The IR remote control is quite sensitive. It can be disturbed by sun lights.
If you have any questions in uploading code to Me-Baseboard, go visit this link.
http://wiki.makeblock.cc/index.php?title=Makeblock_Robot_Starter_Kit#Programming
In my code, I define the buttons as below.
There are more details in the code.
Test: Camera Focus
Plus: Increase delay time
Return: Delay variable back to 1
Previous: Decrease shot_time variable (50 times in taking picture)
Play: Take a picture
Next: Increase shot_time variable (50 times in taking picture)
0 number key: Long expose mode
1 picture,
10 sec expose (depends on delay time variable; unit: 10 sec)
1 number key: 50 pictures (depends on shot_time variable; unit: 50 pictures)
1 second between taking next picture,
0.5 sec expose (depends on delay time variable; unit: 0.5 sec)
2 number key: 50 pictures (depends on shot_time variable)
2 second between taking next picture,
0.5 sec expose (depends on delay time variable; unit: 50 pictures)
3 number key: 50 pictures (depends on shot_time variable)
3 second between taking next picture,
0.5 sec expose (depends on delay time variable; unit 0.5 sec)
......
9 number key: 50 pictures (depends on shot_time variable; unit: 50 pictures)
9 second between taking next picture,
0.5 sec expose (depends on delay time variable, unit: 0.5 sec)
#include <Makeblock.h>
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>
MeShutter myshutter(PORT3);
MeInfraredReceiver infraredReceiverDecode(PORT_6);
int timedelay = 1; //Time delay variable
int shot_time = 1; //The variable used in changing how many times you want to shot
int i;
void setup()
{
infraredReceiverDecode.begin();
// initialize serial communications at 9600 bps
Serial.begin(9600);
}
void loop()
{
if(infraredReceiverDecode.available())
{
switch(infraredReceiverDecode.read())
{
case IR_BUTTON_POWER: //Not in use
Serial.println("Press Power.");break;
//////
case IR_BUTTON_MENU: //Not in use
Serial.println("Press Menu.");break;
//////
case IR_BUTTON_TEST: //Camera focus
myshutter.focusOn();
delay(2000);
myshutter.focusOff();
Serial.println("Press Test.");break;
//////
case IR_BUTTON_PLUS: //increase the delay time
timedelay++;
Serial.println(timedelay);
Serial.println("Press Plus.");
break;
//////
case IR_BUTTON_RETURN: //change the time delay variable to 1
timedelay=1;
Serial.println(timedelay);
Serial.println("Press Return.");break;
//////
case IR_BUTTON_PREVIOUS: //decrease the variable and take 50 less pictures
if(shot_time>1)
{
shot_time--;
}
else
{
shot_time = 1;
}
Serial.println(shot_time);
Serial.println("Press Previous.");break;
//////
case IR_BUTTON_PLAY: //take a picture once
myshutter.focusOn();
delay(2000);
myshutter.focusOff();
myshutter.shotOn();
delay(1500);
myshutter.shotOff();
Serial.println("Press Play.");break;
//////
case IR_BUTTON_NEXT: //increase the shot time variable and take 50 more pictures
shot_time++;
Serial.println(shot_time);
Serial.println("Press Next.");break;
//////
case IR_BUTTON_MINUS: //decrease the time variable
if(timedelay>1)
{
timedelay--;
}
else
{
timedelay = 1;
}
Serial.println(timedelay);
Serial.println("Press Minus.");break;
//////
case IR_BUTTON_CLR:
shot_time = 1;
Serial.println(shot_time);
Serial.println("Press Clr.");break;
//////
case IR_BUTTON_0: //Used in long-expose (expose 10 sec when variable is 1 and increase by 10 sec)
myshutter.shotOn();
for(i=0; i<timedelay; i++)
{
delay(10000);
}
myshutter.shotOff();
Serial.println("Press 0.");break;
//////
case IR_BUTTON_1: //Take 50 pictures when shot_time = 1 and changes by 50. Expose time is 0.5 sec and changes by each 0.5 sec
for(i= 0; i<50*shot_time;i++)
{
myshutter.shotOn();
delay(timedelay*500);
myshutter.shotOff();
delay(1000); // Time between each shot is 1 sec
}
Serial.println("Press 1.");break;
//////
case IR_BUTTON_2: //Take 50 pictures when shot_time = 1 and changes by 50. Expose time is 0.5 sec and changes by each 0.5 sec
for(i= 0; i<50*shot_time;i++)
{
myshutter.shotOn();
delay(timedelay*500);
myshutter.shotOff();
delay(2*1000); // Time between each shot is 2 sec
}
Serial.println("Press 2.");break;
//////
case IR_BUTTON_3: //Take 50 pictures when shot_time = 1 and changes by 50. Expose time is 0.5 sec and changes by each 0.5 sec
for(i= 0; i<50*shot_time;i++)
{
myshutter.shotOn();
delay(timedelay*500);
myshutter.shotOff();
delay(3*1000); // Time between each shot is 3 sec
}
Serial.println("Press 3.");break;
//////
case IR_BUTTON_4: //Take 50 pictures when shot_time = 1 and changes by 50. Expose time is 0.5 sec and changes by each 0.5 sec
for(i= 0; i<50*shot_time;i++)
{
myshutter.shotOn();
delay(timedelay*500);
myshutter.shotOff();
delay(4*1000); // Time between each shot is 4 sec
}
Serial.println("Press 4.");break;
//////
case IR_BUTTON_5: //Take 50 pictures when shot_time = 1 and changes by 50. Expose time is 0.5 sec and changes by each 0.5 sec
for(i= 0; i<50*shot_time;i++)
{
myshutter.shotOn();
delay(timedelay*500);
myshutter.shotOff();
delay(5*1000); // Time between each shot is 5 sec
}
Serial.println("Press 5.");break;
//////
case IR_BUTTON_6: //Take 50 pictures when shot_time = 1 and changes by 50. Expose time is 0.5 sec and changes by each 0.5 sec
for(i= 0; i<50*shot_time;i++)
{
myshutter.shotOn();
delay(timedelay*500);
myshutter.shotOff();
delay(6*1000); // Time between each shot is 6 sec
}
Serial.println("Press 6.");break;
//////
case IR_BUTTON_7: //Take 50 pictures when shot_time = 1 and changes by 50. Expose time is 0.5 sec and changes by each 0.5 sec
for(i= 0; i<50*shot_time;i++)
{
myshutter.shotOn();
delay(timedelay*500);
myshutter.shotOff();
delay(7*1000); // Time between each shot is 7 sec
}
Serial.println("Press 7.");break;
//////
case IR_BUTTON_8: //Take 50 pictures when shot_time = 1 and changes by 50. Expose time is 0.5 sec and changes by each 0.5 sec
for(i= 0; i<50*shot_time;i++)
{
myshutter.shotOn();
delay(timedelay*500);
myshutter.shotOff();
delay(8*1000); // Time between each shot is 8 sec
}
Serial.println("Press 8.");break;
//////
case IR_BUTTON_9: //Take 50 pictures when shot_time = 1 and changes by 50. Expose time is 0.5 sec and changes by each 0.5 sec
for(i= 0; i<50*shot_time;i++)
{
myshutter.shotOn();
delay(timedelay*500);
myshutter.shotOff();
delay(9*1000); // Time between each shot is 9 sec
}
Serial.println("Press 9.");break;
default:break;
}
}
}
Discussions
3 years ago on Introduction
Hi, Can you make it at home?