<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
		<id>http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Gyroscope</id>
		<title>Gyroscope - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Gyroscope"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Gyroscope&amp;action=history"/>
		<updated>2026-04-22T16:27:02Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Gyroscope&amp;diff=2755&amp;oldid=prev</id>
		<title>Pkj：Created page with &quot;{{Language | 陀螺仪}} {| style=&quot;width: 800px;&quot; |- | ==Objective== This tutorial will use the Microduino-10DOF module's gyroscope and accelerometer sensor to measure data, a...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Gyroscope&amp;diff=2755&amp;oldid=prev"/>
				<updated>2014-05-22T12:49:33Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Language | 陀螺仪}} {| style=&amp;quot;width: 800px;&amp;quot; |- | ==Objective== This tutorial will use the Microduino-10DOF module&amp;#039;s gyroscope and accelerometer sensor to measure data, a...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Language | 陀螺仪}}&lt;br /&gt;
{| style=&amp;quot;width: 800px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
==Objective==&lt;br /&gt;
This tutorial will use the Microduino-10DOF module's gyroscope and accelerometer sensor to measure data, and then display the data in Processing.&lt;br /&gt;
&lt;br /&gt;
==Equipment==&lt;br /&gt;
*'''[[Microduino-Core]]'''&lt;br /&gt;
*'''[[Microduino-FT232R]]'''&lt;br /&gt;
'''[[Microduino-10DOF]]'''&lt;br /&gt;
*Other equipment&lt;br /&gt;
**USB cable           one  &lt;br /&gt;
&lt;br /&gt;
==Schematic==&lt;br /&gt;
&lt;br /&gt;
Use the Microduino-10DOF module's gyroscope and accelerometer sensor directly.&lt;br /&gt;
&lt;br /&gt;
==Program==&lt;br /&gt;
&lt;br /&gt;
Refers to MPU6050Microduino&lt;br /&gt;
&lt;br /&gt;
processingGyro&lt;br /&gt;
&lt;br /&gt;
==Debug==&lt;br /&gt;
&lt;br /&gt;
Step 1：Set up hardware system, as follows:&lt;br /&gt;
[[File:AtmosphericDataCollectionConnectionDiagram.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
Step 2: Explain the code:&lt;br /&gt;
&lt;br /&gt;
This example needs two parts code, one is Processing and the other is Microduino.&lt;br /&gt;
&lt;br /&gt;
Microduino:&lt;br /&gt;
&lt;br /&gt;
//Get the gyroscope and accelerometer sensor's data and output to serial to dispaly.&lt;br /&gt;
&lt;br /&gt;
  void loop() {&lt;br /&gt;
      accelgyro.getMotion6(&amp;amp;ax, &amp;amp;ay, &amp;amp;az, &amp;amp;gx, &amp;amp;gy, &amp;amp;gz);&lt;br /&gt;
      sprintf(str, &amp;quot;%d,%d,%d,%d,%d,%d,%d&amp;quot;, ax, ay, az, gx, gy, gz); &lt;br /&gt;
      Serial.print(str);&lt;br /&gt;
      Serial.write(byte(10));&lt;br /&gt;
      delay(20);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Processing:&lt;br /&gt;
&lt;br /&gt;
//Get the first serial port data.&lt;br /&gt;
  myPort = new Serial(this, Serial.list()[0], 9600); // first COM port&lt;br /&gt;
&lt;br /&gt;
//Display Microduino received data in screen.&lt;br /&gt;
&lt;br /&gt;
Function description：&lt;br /&gt;
&lt;br /&gt;
readSensors()  //Read the sensor data&lt;br /&gt;
&lt;br /&gt;
normalize3DVec(float [] vector)  //Process the 3d vector&lt;br /&gt;
&lt;br /&gt;
buildBoxShape()  //Setup the shap of box&lt;br /&gt;
&lt;br /&gt;
drawCube()   //Draw the box&lt;br /&gt;
&lt;br /&gt;
getInclination()  //Get the angle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 3: Compile the code and download it.&lt;br /&gt;
&lt;br /&gt;
Step 4: After running, rotate the Microduino module and observe Microduino's display.&lt;br /&gt;
&lt;br /&gt;
==Result==&lt;br /&gt;
A box will be displayed in screen, it can simulate the Microduino's posture, as follows:&lt;br /&gt;
[[File:processingGyroResult.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Video==&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Pkj</name></author>	</entry>

	</feed>