查看“Music Box(Joystick)”的源代码
←
Music Box(Joystick)
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{Language| Music Box(Joystick)}} {| style="width: 800px;" |- | ==Overview== Build a music box here! You can play the music files in the TF card, select the song with Joystic rocker and change volume. [[File: MusicBox_Joystick.jpg|600px|center]] ==Schematic== Rocker XY direction movement detection by reading the analog value to judge. At the same judge to stay the length of time to select the control mode. [[File: MusicBox_Joystick-sch_E.jpg|600px|center]] ==Equipment== {|class="wikitable" |- |Module||Number||Function |- |[[mCookie-CoreUSB/zh]]||1||Core board |- |[[mCookie-Hub/zh]]||1||Sensor pin board |- |[[mCookie-Audio/zh]]||1||Audio Module |- |[[mCookie-Amplifier/zh]]||1||Power amplifier module |- | [[mCookie-BM/zh]]||1||Battery Management |- | [[Microduino-Joystick/zh]]||1||JoyStick |} *Other Equipment: **2 Speaker **1 Batteray **1 TF card [[File: MusicBox_Joystick-module.jpg|600px|center]] [[File: MusicBox_Joystick-module1_E.jpg|600px|center]] ==Code== *Setup 1:Connect the CoreUSB module to your computer and then start the Arduino IDE. [[File:CoreUSB_Ble_pc.jpg|600px|center]] * Setup 2:Select Files>Examples>mCokie>_203_MusicBox_Joystick [[File: _MusicBox_Joystick _ino.jpg|600px|center]] * Setup 3:Click upload button to upload program. When "Done Uploading" appears, the program should have successfully been uplloaded into the CoreUSB. [[File: _MusicBox_Joystick _ino-ok.jpg|600px|center]] ==Software Debuge== *” audio.h” Audio lib file *Audio module Serial uses D2, D3 <source lang="cpp"> #include <SoftwareSerial.h> SoftwareSerial mySerial(2, 3); // RX, TX #define AUDIO_PORT mySerial </source> *Detection rocker value <source lang="cpp"> int uiStep() //Change songs { if (analogRead(A0) < 100) //Y-up { delay(50); //50 ms delay if (analogRead(A0) < 100) // return 1; //return 1 } if (analogRead(A1) < 100) // { delay(50); //50 ms delay if (analogRead(A1) < 100) //X-Right return 2; //return 2 } if (analogRead(A1) > 900) //X-Left { delay(50); //50 ms delay if (analogRead(A1) > 900) // return 3; //Return to 3 } return 0; } </source> *OLED displays interface and user can change it. <source lang="cpp"> //The main interface can be freely changed. void draw() { setFont_L; u8g.setPrintPos(4, 16); u8g.print("Music_sta:"); u8g.print(music_status ? "play" : "pause"); u8g.setPrintPos(4, 16 * 2); u8g.print("Music_vol:"); u8g.print(music_vol); u8g.print("/30"); u8g.setPrintPos(4, 16 * 3); u8g.print("Music_num:"); u8g.print(music_num); u8g.print("/"); u8g.print(music_num_MAX); u8g.setPrintPos(4, 16 * 4); u8g.print("....Microduino...."); //u8g.print(rtc.formatTime(RTCC_TIME_HMS)); } </source> ==Hardware Buildup== *Setup 1:Using the above diagram as reference, connect the sensors into the corrensponding ports on the Hub module. [[File: _MusicBox_Joystick _hub.jpg|600px|center]] *Setup 2:Insert a micro SD card into the Audio Shield. [[File: _MusicBox_Joystick _TF.jpg|600px|center]] *Setup 3:Stack the Audio Shield and Audio modules.Even though your micro SD card may be able to store many songs, the program we provide only supports up to 9 songs. [[File: _MusicBox_Joystick _song.jpg|600px|center]] *Setup4:Connect the speakers into the Amplifier module. [[file: MusicBox_Joystick _song_speak.JPG|600px|center]] *Setup5:Stack the Amplifier, Audio, and Audio Shield modules. [[file: MusicBox_Joystick _3_speak_E.JPG|600px|center]] *Setup6:Connect the activated Battery module to your Battery Management module. [[File:CoreUSB_Ble_steup2.jpg|600px|center]] *Setup7:Stack all the modules together in any order you like (Except three Audio modules, They must be together). Congratulations, you have finished building the circuit! [[file: MusicBox_Joystick _steup_ok_E.JPG|600px|center]] ==How to Operate== [[file: MusicBox_Joystick _caozuo-E.JPG|600px|center]] ==Result== Control music playback, pause and change songs by using Joystick. You can also build a nice look LEGO Shell. [[file: MusicBox_Joystick _ok.JPG|600px|center]] ==Video== |}
该页面使用的模板:
模板:Language
(
查看源代码
)
模板:Nmbox
(
查看源代码
)
返回至
Music Box(Joystick)
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
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
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息