Difference between revisions of "Say Cheese"
From Microduino Wiki
(→Equipment) |
|||
Line 31: | Line 31: | ||
*Setup 1:Connect CoreUSB and your PC/Mac with a USB cable, and then open Arduino IDE. | *Setup 1:Connect CoreUSB and your PC/Mac with a USB cable, and then open Arduino IDE. | ||
[[Image:CoreUSB_Ble_pc.jpg|600px|center]] | [[Image:CoreUSB_Ble_pc.jpg|600px|center]] | ||
− | *Setup 2:Click file > example> mCookie > | + | *Setup 2:Click file > example> mCookie > _205_SayCheese |
[[File: take_photo-upload2.jpg|600px|center]] | [[File: take_photo-upload2.jpg|600px|center]] | ||
*Setup 3:Select the right board and COM port, and then download the program. | *Setup 3:Select the right board and COM port, and then download the program. | ||
[[File: take_photo-upload3.jpg|600px|center]] | [[File: take_photo-upload3.jpg|600px|center]] | ||
+ | |||
==Software Debugging== | ==Software Debugging== | ||
*Define Sony camera infrared transmitting code | *Define Sony camera infrared transmitting code |
Revision as of 21:06, 27 July 2016
Language: | English • 中文 |
---|
ContentsObjectiveSay "Cheese!" towards MIC, it will send out infrared signal and at the same time, the camera will take a picture. PrincipleEquipment
Program Download
Software Debugging
#define PHOTO 0xB4B8F
#define mic_pin A0
#define IR_pin 6
#define voice 400#define voice 400
if (voice_data > voice && take == false)
{
time = millis();
num++;
delay(10);
Serial.println(num);
if (num > 20)
{
take = true;
takePhoto();
Serial.println("takePhoto...");
}
}
else if (millis() - time > 1000 )//Take pictures after one second. {
voice_data = analogRead(mic_pin);
if (voice_data < voice)
{
num = 0;
take = false;
}
time = millis();
}
void takePhoto()
{
for (int i = 0; i < 3; i++)
{
irsend.sendSony(PHOTO, 20); // Sony code
delay(10);
}
} Hardware Buildup
CautionResultYell at MIC and trigger the camera. Video |