查看“Dashboard”的源代码
←
Dashboard
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{| style="width: 800px;" |- | ==Objective== The course will show you how to achieve a dashboard through Processing to display the inductive magnetic field change of Microduino. ==Equipment== *'''[[Microduino-Core]]''' *'''[[Microduino-FT232R]]''' *'''[[Microduino-10DOF]]''' *Other Hardware Equipment **A USB cable ==Schematic== Just use the HMC5883L magnetic field strength sensor of Microduino-10DOF. ==Program== https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Processing/MicroduinoDashboard https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Processing/ProcessingDashboard ==Debugging== Step 1:Build the hardware environment according to the schematic, just like: [[File:processingDashboardConnectionDiagram.jpg|600px|center|thumb]] Download the library function of HMC5883L: https://github.com/manifestinteractive/arduino/tree/master/Libraries/HMC5883L Step 2: Here is the code: The code of the two ends(Processing and Microduino) Microduino: Initialize HMC5883L in “setup()” Calculate the angle of the magnetic induction //Output() used to output the calculated angle to the serial port // Output the data down the serial port. void Output(int RoundDegreeInt) { //Serial.println(); Serial.println(RoundDegreeInt); delay(150); } Processing: //Get the data of the first serial port. myPort = new Serial(this, Serial.list()[0], 9600); //The code below in drawCube() is used to acquire the serial data while (myPort.available() > 0) { myString = myPort.readStringUntil(lf); if (myString != null) { //print(myString); // Prints String angle=float(myString); // Converts and prints float println(angle); } } Function Reference: //Draw the center point of the dashboard buildpoint() //Draw the dashboard and the pointer scale builddashboard() //Receive the serial data and draw the center point drawCube() //Draw the whole dashboard drawCube1() Step 3:Download the code and get it compiled successfully. Step 4:Use a magnet to change the magnetic field to see if the pointer changes after the system goes well. ==Result== A little compass will be displayed on the scree, which goes along with the change of the magnetic field, just like: [[File:processingDashboardResult.jpg|600px|center|thumb]] ==Video==
返回至
Dashboard
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
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
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息