查看“Screaming Monster”的源代码
←
Screaming Monster
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{Language| Screaming Monster }} {| style="width: 800px;" |- | ==Objective== This project can detect human movement. When someone passes by, it'll send out monster scream. ==Principle== ==Equipment== {|class="wikitable" |- |Module||Number||Function |- |[[Microduino-CoreUSB]]||1||Core board |- |[[Microduino-Sensorhub]]||1||Sensor pin board |- |[[Microduino-TOUCH]]||1||Touch sensor |- |[[Microduino-PIR]]||1||Infrared pyroelectric sensor |- |[[Microduino-Audio]]||1||Audio module |- |[[Microduino-Amplifier]]||1||Audio power amplifier |- | [[Microduino-BM]]||1||Battery management |} [[File: MicroduinoSkreech.jpg|600px|center|thumb]] ==Hardware Buildup== *Setup 1:Connect the CoreUSB to the computer, open the program examples, select the right board and serial monitor, and then download the program. [[File:MicroduinoSkreech1.jpg|600px|center|thumb]] *Setup2:Connect the Touch sensor to Sensorhub D6 and the PIR to D10. [[file:Microduino-sensorhub_rule.JPG|thumb|800px|center]] [[file: MicroduinoSkreech2.JPG|thumb|800px|center]] *Setup3:Connect the battery with BM. [[file: MicroduinoSkreech3.JPG|thumb|800px|center]] ==Software Debugging== Code Description *Define the Control Pin <source lang="cpp"> #define humanHotSensor 10 #define buttonPin 6 </source> *Detect human infrared and play audio. <source lang="cpp"> void pirDetector() { // read the input pin: humanHotState = digitalRead(humanHotSensor); // print out the state of the button: //Serial.println(humanHotState); delay(1); // delay in between reads for stability if(humanHotState) { Serial.println("play sound....."); audio_choose(1);// 2:health,1:noHealth audio_play(); } } </source> *Judge if some touch the button. <source lang="cpp"> void updateButton() { if(key_get(buttonPin,0)) { delay(200); on_off=!on_off; } if(statusChange!=on_off) { statusChange=on_off; if(on_off) { Serial.println("pause"); audio_pause(); } else { Serial.println("pause"); audio_pause(); } } } </source> ==Program== [[https://github.com/Microduino/Microduino_Tutorials/tree/master/MCookie_Tutorial/MicroduinoSkreech MicroduinoSkreech]] ==Result== It can detect human movement. When someone passes by, it'll scream. By touching the button, it will stop screaming. ==Video== |}
该页面使用的模板:
模板:Language
(
查看源代码
)
模板:Nmbox
(
查看源代码
)
返回至
Screaming Monster
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
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
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息