<?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=Servo.attach%28%29</id>
		<title>Servo.attach() - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Servo.attach%28%29"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Servo.attach()&amp;action=history"/>
		<updated>2026-04-29T19:26:59Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Servo.attach()&amp;diff=23077&amp;oldid=prev</id>
		<title>2017年12月15日 (五) 10:12 1196357542@qq.com</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Servo.attach()&amp;diff=23077&amp;oldid=prev"/>
				<updated>2017-12-15T10:12:08Z</updated>
		
		<summary type="html">&lt;p&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;2017年12月15日 (五) 10:12的版本&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-l8&quot; &gt;第8行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第8行：&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;&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;&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''参数'''&amp;lt;/p&amp;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;&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''参数'''&amp;lt;/p&amp;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;pin:引脚号&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;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;pin&lt;ins class=&quot;diffchange diffchange-inline&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;/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;min:控制角度的脉冲的高电平时间最小值，数值单位为us，默认544&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;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;min&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;:控制角度的脉冲的高电平时间最小值，数值单位为us，默认544&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;max:控制角度的脉冲的高电平时间最大值，数值单位为us，默认2400&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;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;max&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;:控制角度的脉冲的高电平时间最大值，数值单位为us，默认2400&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;&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 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;/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;&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;&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''参数'''&amp;lt;/p&amp;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;&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''参数'''&amp;lt;/p&amp;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;pin:引脚号&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;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;pin&lt;ins class=&quot;diffchange diffchange-inline&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;/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;&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;/table&gt;</summary>
		<author><name>1196357542@qq.com</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Servo.attach()&amp;diff=23066&amp;oldid=prev</id>
		<title>1196357542@qq.com：创建页面，内容为“ &lt;p style=&quot;color: #666666;font-size:220%&quot;&gt;'''Servo.attach(pin，min，max)'''&lt;/p&gt; &lt;br&gt;  &lt;p style=&quot;color: #E87E05;font-size:135%&quot;&gt;'''作用'''&lt;/p&gt; 舵机初始化，…”</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Servo.attach()&amp;diff=23066&amp;oldid=prev"/>
				<updated>2017-12-15T08:39:57Z</updated>
		
		<summary type="html">&lt;p&gt;创建页面，内容为“ &amp;lt;p style=&amp;quot;color: #666666;font-size:220%&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;Servo.attach(pin，min，max)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;作用&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt; 舵机初始化，…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #666666;font-size:220%&amp;quot;&amp;gt;'''Servo.attach(pin，min，max)'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''作用'''&amp;lt;/p&amp;gt;&lt;br /&gt;
舵机初始化，连接到引脚pin上,并设置控制角度的脉冲的高电平时间范围min-max，一般在0.5ms-2.5ms之间&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''参数'''&amp;lt;/p&amp;gt;&lt;br /&gt;
pin:引脚号&lt;br /&gt;
&lt;br /&gt;
min:控制角度的脉冲的高电平时间最小值，数值单位为us，默认544&lt;br /&gt;
&lt;br /&gt;
max:控制角度的脉冲的高电平时间最大值，数值单位为us，默认2400&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''返回值'''&amp;lt;/p&amp;gt;&lt;br /&gt;
返回值n为当前舵机是被连接的第n号舵机，uint8_t型数据&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #666666;font-size:220%&amp;quot;&amp;gt;'''Servo.attach(pin)'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''作用'''&amp;lt;/p&amp;gt;&lt;br /&gt;
舵机初始化，连接到引脚pin上,并设置控制角度的脉冲的高电平时间为默认范围：544-2400&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''参数'''&amp;lt;/p&amp;gt;&lt;br /&gt;
pin:引脚号&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''返回值'''&amp;lt;/p&amp;gt;&lt;br /&gt;
返回值n为当前舵机是被连接的第n号舵机，uint8_t型数据&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''示例'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Servo.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Servo myservo;  // create servo object to control a servo&lt;br /&gt;
// a maximum of eight servo objects can be created&lt;br /&gt;
&lt;br /&gt;
#define servoPin  D9&lt;br /&gt;
&lt;br /&gt;
int pos = 0;    // variable to store the servo position&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  myservo.attach(servoPin);  // attaches the servo on pin 9 to the servo object&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  for (pos = 0; pos &amp;lt; 180; pos += 1) // goes from 0 degrees to 180 degrees&lt;br /&gt;
  { // in steps of 1 degree&lt;br /&gt;
    myservo.write(pos);              // tell servo to go to position in variable 'pos'&lt;br /&gt;
    delay(15);                       // waits 15ms for the servo to reach the position&lt;br /&gt;
  }&lt;br /&gt;
  for (pos = 180; pos &amp;gt;= 1; pos -= 1) // goes from 180 degrees to 0 degrees&lt;br /&gt;
  {&lt;br /&gt;
    myservo.write(pos);              // tell servo to go to position in variable 'pos'&lt;br /&gt;
    delay(15);                       // waits 15ms for the servo to reach the position&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;'''其他'''&amp;lt;/p&amp;gt;&lt;br /&gt;
【[[Servo]]】&lt;br /&gt;
&lt;br /&gt;
【[[Servo.detach()]]】&lt;br /&gt;
&lt;br /&gt;
【[[Servo.write()]]】&lt;br /&gt;
&lt;br /&gt;
【[[Servo.writeMicroseconds()]]】&lt;br /&gt;
&lt;br /&gt;
【[[Servo.read()]]】&lt;br /&gt;
&lt;br /&gt;
【[[Servo.readMicroseconds()]]】&lt;br /&gt;
&lt;br /&gt;
【[[Servo.attached()]]】&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Sensor-Servo_Reference|返回Servo_Reference页面]]&lt;/div&gt;</summary>
		<author><name>1196357542@qq.com</name></author>	</entry>

	</feed>