<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wikihandbk.com/ruwiki/index.php?action=history&amp;feed=atom&amp;title=Arduino%3A%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B%2FMotorKnob</id>
	<title>Arduino:Примеры/MotorKnob - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wikihandbk.com/ruwiki/index.php?action=history&amp;feed=atom&amp;title=Arduino%3A%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B%2FMotorKnob"/>
	<link rel="alternate" type="text/html" href="http://wikihandbk.com/ruwiki/index.php?title=Arduino:%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B/MotorKnob&amp;action=history"/>
	<updated>2026-06-07T12:59:15Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>http://wikihandbk.com/ruwiki/index.php?title=Arduino:%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B/MotorKnob&amp;diff=8495960&amp;oldid=prev</id>
		<title>EducationBot в 08:36, 8 июля 2023</title>
		<link rel="alternate" type="text/html" href="http://wikihandbk.com/ruwiki/index.php?title=Arduino:%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B/MotorKnob&amp;diff=8495960&amp;oldid=prev"/>
		<updated>2023-07-08T08:36:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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 class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 12:36, 8 июля 2023&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-l106&quot;&gt;Строка 106:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 106:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;references /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;references /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;{{Навигационная таблица/Портал/Arduino}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Пример]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; 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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Примеры]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; 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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Пример программирования Arduino]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Пример программирования Arduino]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Примеры программирования Arduino]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Примеры программирования Arduino]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>EducationBot</name></author>
	</entry>
	<entry>
		<id>http://wikihandbk.com/ruwiki/index.php?title=Arduino:%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B/MotorKnob&amp;diff=7735729&amp;oldid=prev</id>
		<title>EducationBot в 08:33, 20 мая 2023</title>
		<link rel="alternate" type="text/html" href="http://wikihandbk.com/ruwiki/index.php?title=Arduino:%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B/MotorKnob&amp;diff=7735729&amp;oldid=prev"/>
		<updated>2023-05-20T08:33:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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 class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 12:33, 20 мая 2023&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-l50&quot;&gt;Строка 50:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 50:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Подходит и для однополярного, и для двухполярного шагового мотора.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; 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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&amp;lt;syntaxhighlight lang=&quot;c&quot; line=&quot;GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot; enclose=&quot;div&lt;/del&gt;&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&amp;lt;syntaxhighlight lang=&quot;c&quot; line=&quot;GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/* Управление шаговым мотором&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; 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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>EducationBot</name></author>
	</entry>
	<entry>
		<id>http://wikihandbk.com/ruwiki/index.php?title=Arduino:%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B/MotorKnob&amp;diff=20837&amp;oldid=prev</id>
		<title>Myagkij: Замена текста — «&lt;syntaxhighlight lang=&quot;c&quot; line=&quot;GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS&quot;&gt;» на «&lt;syntaxhighlight lang=&quot;c&quot; line=&quot;GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS&quot; enclose=&quot;div&quot;&gt;»</title>
		<link rel="alternate" type="text/html" href="http://wikihandbk.com/ruwiki/index.php?title=Arduino:%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B/MotorKnob&amp;diff=20837&amp;oldid=prev"/>
		<updated>2016-12-13T17:24:37Z</updated>

		<summary type="html">&lt;p&gt;Замена текста — «&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line=&amp;quot;GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS&amp;quot;&amp;gt;» на «&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line=&amp;quot;GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Arduino панель перехода}}&lt;br /&gt;
{{Перевод от Сubewriter}}&lt;br /&gt;
{{Myagkij-редактор}}&lt;br /&gt;
&lt;br /&gt;
==Управление шаговым мотором&amp;lt;ref&amp;gt;[https://www.arduino.cc/en/Tutorial/MotorKnob Arduino - Stepper Motor Knob]&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Шаговыми моторами, благодаря их уникальному дизайну, можно управлять с очень высокой точностью и без необходимости использовать разного рода механизмы обратной связи. Вал шагового мотора (установленный при помощи нескольких магнитов) управляется серией электромагнитных пружин, в особой последовательности заряжаемых то положительным, то отрицательным зарядом. Это позволяет ему двигаться вперед и назад маленькими и очень точными «шажками».&lt;br /&gt;
&lt;br /&gt;
Существует два вида шаговых моторов – однополярные и двухполярные – и очень важно знать, какой именно вид вы используете, потому что для каждого вида нужна своя особая цепь. Информацию о постройке цепи для обоих случаев смотрите ниже, причем приложенный в конце урока код работает и с однополярным, и с двухполярным шаговым мотором.&lt;br /&gt;
&lt;br /&gt;
В этом примере потенциометр (или другой прибор) подключен к '''0-ому входному аналоговому''' контакту на '''Arduino''' – это и библиотека '''Stepper''' позволит управлять движением шагового мотора. Сам шаговый мотор подключен к '''цифровым контактам 8, 9, 10 и 11''' (и для полярных, и двухполярных).&lt;br /&gt;
&lt;br /&gt;
Кроме того, к '''Arduino''' нужно подключить [https://octopart.com/uln2004a-stmicroelectronics-4798 транзистор Дарлингтона U2004] (если используете однополярный мотор) или [https://octopart.com/sn754410ne-texas%2Binstruments-1320 H-мост SN754410NE] (если двухполярный). &lt;br /&gt;
&lt;br /&gt;
Более подробно о разнице между двумя видами шаговых моторов можно прочесть на [http://www.tigoe.net/pcomp/code/circuits/motors/stepper-motors сайте Тома Иго].&lt;br /&gt;
&lt;br /&gt;
==Необходимое оборудование==&lt;br /&gt;
&lt;br /&gt;
* Плата '''Arduino''';&lt;br /&gt;
* Потенциометр;&lt;br /&gt;
* Шаговый мотор;&lt;br /&gt;
* Транзистор '''Дарлингтона U2004''' (если используете однополярный шаговый мотор);&lt;br /&gt;
* '''H-мост SN754410ne''' (если используете двухполярный шаговый мотор);&lt;br /&gt;
* Питание, достаточное для работы вашего шагового мотора;&lt;br /&gt;
* Макетная плата '''Breadboard''';&lt;br /&gt;
* Провода-перемычки;&lt;br /&gt;
&lt;br /&gt;
==Цепь и схема==&lt;br /&gt;
&lt;br /&gt;
Ниже можно найти схемы, показывающие то, как построить цепь и для однополярного, и для двухполярного шагового мотора. Но в любом случае их лучше запитать от внешнего источника, т.к. они требуют слишком много энергии, и возможностей '''Arduino''' для этого не хватает. &lt;br /&gt;
&lt;br /&gt;
Также в обоих случаях к цепи нужно подключить потенциометр на '''10 кОм''': боковые контакты – к питанию и «земле», а центральный – к '''0-ому аналоговому контакту'''. &lt;br /&gt;
&lt;br /&gt;
'''Примечание:''' Ниже показаны схемы только для '''4-контактного соединения'''. Код выстроен таким образом, что с '''2-контактным соединением''' он работать не будет. &lt;br /&gt;
&lt;br /&gt;
===Цепь и схема для однополярного:===&lt;br /&gt;
&lt;br /&gt;
[[File:UnipolarKnob_bbsm.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:UnipolarKnob_schms.png]]&lt;br /&gt;
&lt;br /&gt;
===Цепь и схема для двухполярного:===&lt;br /&gt;
&lt;br /&gt;
[[File:bipolarKnob_bbsm.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:bipolarKnob_schms.png]]&lt;br /&gt;
&lt;br /&gt;
==Код==&lt;br /&gt;
&lt;br /&gt;
Подходит и для однополярного, и для двухполярного шагового мотора.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line=&amp;quot;GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
/* Управление шаговым мотором&lt;br /&gt;
&lt;br /&gt;
Вал шагового мотора будет поворачиваться вслед за поворотом ручки&lt;br /&gt;
потенциометра (или в соответствии с изменением данных от другого&lt;br /&gt;
датчика, стоящего вместо потенциометра), подключенного к 0-ому&lt;br /&gt;
входному аналоговому контакту.&lt;br /&gt;
&lt;br /&gt;
http://www.arduino.cc/en/Reference/Stepper&lt;br /&gt;
&lt;br /&gt;
Этот код не защищен авторским правом.&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;Stepper.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Поменяйте это число на количество «шагов» вашего мотора:&lt;br /&gt;
#define STEPS 100&lt;br /&gt;
&lt;br /&gt;
// Создаем экземпляр класса Stepper, указываем количество шагов&lt;br /&gt;
// и контакты, к которым подсоединен шаговый мотор:&lt;br /&gt;
Stepper stepper(STEPS, 8, 9, 10, 11);&lt;br /&gt;
&lt;br /&gt;
// Результат предыдущего считывания с входного аналогового контакта:&lt;br /&gt;
int previous = 0;&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  // Задаем скорость вращения мотора на 30 оборотов в минуту:&lt;br /&gt;
  stepper.setSpeed(30);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  // Получаем данные от датчика:&lt;br /&gt;
  int val = analogRead(0);&lt;br /&gt;
&lt;br /&gt;
  // Двигаемся на количество шагов согласно данным от датчика:&lt;br /&gt;
  stepper.step(val - previous);&lt;br /&gt;
&lt;br /&gt;
  // Запоминаем предыдущий результат от датчика:&lt;br /&gt;
  previous = val;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== См.также==&lt;br /&gt;
&lt;br /&gt;
# Stepper myStepper = Stepper(steps, pin1, pin2, pin3, pin4)&lt;br /&gt;
# stepper.setSpeed()&lt;br /&gt;
# stepper.step()&lt;br /&gt;
# Stepper library reference&lt;br /&gt;
# Sweep - sweep the shaft of a servo motor back and forth.&lt;br /&gt;
# Knob - control the position of a servo with a potentiometer.&lt;br /&gt;
&lt;br /&gt;
==Внешние ссылки==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
[[Категория:Пример]]&lt;br /&gt;
[[Категория:Примеры]]&lt;br /&gt;
[[Категория:Пример программирования Arduino]]&lt;br /&gt;
[[Категория:Примеры программирования Arduino]]&lt;/div&gt;</summary>
		<author><name>Myagkij</name></author>
	</entry>
</feed>