<?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=Joystick%E6%8E%A7%E5%88%B6%E8%88%B5%E6%9C%BA%E6%97%8B%E8%BD%AC</id>
		<title>Joystick控制舵机旋转 - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Joystick%E6%8E%A7%E5%88%B6%E8%88%B5%E6%9C%BA%E6%97%8B%E8%BD%AC"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Joystick%E6%8E%A7%E5%88%B6%E8%88%B5%E6%9C%BA%E6%97%8B%E8%BD%AC&amp;action=history"/>
		<updated>2026-04-20T16:48:12Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Joystick%E6%8E%A7%E5%88%B6%E8%88%B5%E6%9C%BA%E6%97%8B%E8%BD%AC&amp;diff=11696&amp;oldid=prev</id>
		<title>Yanglibin@microduino.cc：/* 搭建硬件 */</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Joystick%E6%8E%A7%E5%88%B6%E8%88%B5%E6%9C%BA%E6%97%8B%E8%BD%AC&amp;diff=11696&amp;oldid=prev"/>
				<updated>2015-11-24T08:21:22Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;搭建硬件&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;zh-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2015年11月24日 (二) 08:21的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l28&quot; &gt;第28行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第28行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File: Joystick_Servo.jpg|600px|center]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File: Joystick_Servo.jpg|600px|center]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==搭建硬件==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==准备==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;==准备&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Setup 1：将Microduino-Servo Connector和舵机连接，接到上一排排针上。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Setup 1：将Microduino-Servo Connector和舵机连接，接到上一排排针上。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[file:mCookie-Servo Connector-sensor.JPG|600px|center]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[file:mCookie-Servo Connector-sensor.JPG|600px|center]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l36&quot; &gt;第36行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第35行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Setup 3：将所有设备连接在一起。通过USB数据线将接入电脑。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Setup 3：将所有设备连接在一起。通过USB数据线将接入电脑。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[file:mCookie-servo-joystick-pc.JPG|600px|center]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[file:mCookie-servo-joystick-pc.JPG|600px|center]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==调试==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==调试==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*打开Arduino IDE，将下列代码复制到IDE中。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*打开Arduino IDE，将下列代码复制到IDE中。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Yanglibin@microduino.cc</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Joystick%E6%8E%A7%E5%88%B6%E8%88%B5%E6%9C%BA%E6%97%8B%E8%BD%AC&amp;diff=11693&amp;oldid=prev</id>
		<title>2015年11月24日 (二) 08:08 Yanglibin@microduino.cc</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Joystick%E6%8E%A7%E5%88%B6%E8%88%B5%E6%9C%BA%E6%97%8B%E8%BD%AC&amp;diff=11693&amp;oldid=prev"/>
				<updated>2015-11-24T08:08:28Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https//wiki.microduino.cn/index.php?title=Joystick%E6%8E%A7%E5%88%B6%E8%88%B5%E6%9C%BA%E6%97%8B%E8%BD%AC&amp;amp;diff=11693&amp;amp;oldid=9048&quot;&gt;显示更改&lt;/a&gt;</summary>
		<author><name>Yanglibin@microduino.cc</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Joystick%E6%8E%A7%E5%88%B6%E8%88%B5%E6%9C%BA%E6%97%8B%E8%BD%AC&amp;diff=9048&amp;oldid=prev</id>
		<title>Hustshenyang@126.com：Created page with &quot;{{Language| Joystick控制舵机旋转}} {| style=&quot;width: 800px;&quot; |- | ==目的== 通过Joystick摇杆来控制舵机进行旋转。  ==原理==  ==设备== {|class=&quot;wikitable...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Joystick%E6%8E%A7%E5%88%B6%E8%88%B5%E6%9C%BA%E6%97%8B%E8%BD%AC&amp;diff=9048&amp;oldid=prev"/>
				<updated>2015-07-15T14:30:39Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Language| Joystick控制舵机旋转}} {| style=&amp;quot;width: 800px;&amp;quot; |- | ==目的== 通过Joystick摇杆来控制舵机进行旋转。  ==原理==  ==设备== {|class=&amp;quot;wikitable...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Language| Joystick控制舵机旋转}}&lt;br /&gt;
{| style=&amp;quot;width: 800px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
==目的==&lt;br /&gt;
通过Joystick摇杆来控制舵机进行旋转。&lt;br /&gt;
&lt;br /&gt;
==原理==&lt;br /&gt;
&lt;br /&gt;
==设备==&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|模块||数量||功能&lt;br /&gt;
|-&lt;br /&gt;
|[[Microduino-CoreUSB/zh]]||1||核心板&lt;br /&gt;
|-&lt;br /&gt;
|[[Microduino-Sensorhub/zh]]||1||传感器转接板&lt;br /&gt;
|-&lt;br /&gt;
| [[Microduino-Servo/zh]]||1||舵机转接板&lt;br /&gt;
|-&lt;br /&gt;
| [[Mirco Servo/zh]]||1||舵机&lt;br /&gt;
|-&lt;br /&gt;
| [[Microduino-Joystick/zh]]||1||摇杆传感器 &lt;br /&gt;
|-&lt;br /&gt;
| [[Microduino-BM/zh]]||1||电源管理&lt;br /&gt;
|}&lt;br /&gt;
 [[File: Joystick_Servo.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==搭建硬件==&lt;br /&gt;
* Setup 1：将CoreUSB接到电脑。打开示例程序，选择好板卡和串口下载程序。&lt;br /&gt;
[https://github.com/Microduino/Microduino_Tutorials/tree/master/MCookie_Tutorial/Joystick_Servo Joystick_Servo]&lt;br /&gt;
*Setup 2：将CoreUSB与Sensorhub叠堆。&lt;br /&gt;
[[File:CoreUSB_Sensorhub.jpg|600px|center|thumb]]&lt;br /&gt;
*Setup 3：将舵机连到舵机转接板，再将舵机转接板接到Sensorhub的D8引脚上,将Joystick摇杆传感器接到A0、A1引脚上。&lt;br /&gt;
[[file:Microduino-sensorhub_rule.JPG|thumb|800px|center]]&lt;br /&gt;
[[File:Joystick_Servo_all.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==软件调试==&lt;br /&gt;
代码说明&lt;br /&gt;
*Joystick控制引脚定义： &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#define JoystickX_PIN A1&lt;br /&gt;
#define JoystickY_PIN A0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*计算Joystick摇杆所在的角度，然后将舵机旋转到对应的角度。&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    float valueX = (float)(analogRead(JoystickX_PIN)-512);&lt;br /&gt;
    float valueY = (float)(analogRead(JoystickY_PIN)-512);&lt;br /&gt;
    float valueL = sqrt(sq(valueX)+sq(valueY));        &lt;br /&gt;
    float angle = asin(valueX/valueL)*180/PI;     //通过反三角函数计算摇杆的角度&lt;br /&gt;
    myservo.write(angle+90);       //舵机旋转到对应角度&lt;br /&gt;
    delay(100);  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==结果==&lt;br /&gt;
将Joystick的摇杆推到不同的角度，舵机也会旋转到对应的角度。&lt;br /&gt;
&lt;br /&gt;
==视频==&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hustshenyang@126.com</name></author>	</entry>

	</feed>