查看“Say Cheese”的源代码
←
Say Cheese
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{Language| Say Cheese }} {| style="width: 800px;" |- | ==Objective== Say "Cheese!" towards MIC, it will send out infrared signal and at the same time, the camera will take a picture. [[File: take_photo.jpg|600px|center]] ==Principle== [[File: take_photo-sch.jpg|600px|center]] ==Equipment== {|class="wikitable" |- |Module||Number||Function |- |[[mCookie-CoreUSB]]||1||Core board |- |[[mCookie-Hub]]||1||Sensor pin board |- | [[mCookie-BM]]||1||Battery management |- | [[Microduino-Microphone]]||1||Sound detection sensor |- | [[Microduino-IR Emitter]]||1||Infrared transmitting sensor |} [[File: take_photo-module.jpg|600px|center]] ==Program Download== *Setup 1:Connect CoreUSB and your PC/Mac with a USB cable, and then open Arduino IDE. [[Image:CoreUSB_Ble_pc.jpg|600px|center]] *Setup 2:Click file > example> mCookie > _204_JoyfulGreeter [[File: take_photo-upload2.jpg|600px|center]] *Setup 3:Select the right board and COM port, and then download the program. [[File: take_photo-upload3.jpg|600px|center]] ==Software Debugging== *Define Sony camera infrared transmitting code <source lang="cpp"> #define PHOTO 0xB4B8F </source> *Control pin definition <source lang="cpp"> #define mic_pin A0 #define IR_pin 6 </source> *Sound trigger value <source lang="cpp"> #define voice 400#define voice 400 </source> *When the sound is louder than the trigger value, the camera will be triggered after a period of time delay and counting. The time delay is decided by function values of "num" and "delay". Users can also change the related parameters can have a try. Taking picture is controlled by the function "take", which can only send photographing instruction once. <source lang="cpp"> if (voice_data > voice && take == false) { time = millis(); num++; delay(10); Serial.println(num); if (num > 20) { take = true; takePhoto(); Serial.println("takePhoto..."); } } </source> *The next shot can be triggered one second later after detecting no sound. <source lang="cpp"> 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(); } </source> *Send photographing instruction function <source lang="cpp"> void takePhoto() { for (int i = 0; i < 3; i++) { irsend.sendSony(PHOTO, 20); // Sony code delay(10); } } </source> ==Hardware Buildup== *Setup1:Connect MIC sensor to A0 pin of the Sensorhub and infrared transmitting sensor to D6 pin. [[file: take_photo _setup_1.jpg |600px|center]] *Setup2:Connect the activated battery box and BM module. [[File:CoreUSB_Ble_steup2.jpg|600px|center]] *Setup3:Stack all modules together without fixed order and finish the buildup. [[file: take_photo _steup_ok.JPG|600px|center]] ==Caution== [[file: take_photo_case.JPG|600px|center]] ==Result== Yell at MIC and trigger the camera. [[file: take_photo_legao-ok.JPG|600px|center]] ==Video== |}
该页面使用的模板:
模板:Language
(
查看源代码
)
模板:Nmbox
(
查看源代码
)
返回至
Say Cheese
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
Welcome
首页
创客大赛
大赛详情
3D打印
安装月球车
图形化编程
操控月球车
升级月球车
编程工具下载
软件下载
Arduino
Processing
Mixly
Scratch
模块套件
Microduino 102
mCookie 102
mCookie 202
mCookie 302
IBC
其他
应用套件
四轴飞行器
平衡车
小车CUBE
音乐播放器
刷卡音乐播放器
wifi气象站
彩虹音乐触摸灯
分贝检测仪
迎门汇报
LED点阵时钟
LED点阵屏幕
硬件
mCookie
Sensor
Microduino
MicroWrt
MicroNux
MicroRobot-Core
MicroRobot-CoreESP
ideaBoard
ideaBox
MicroMV
MicroAI
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息