<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Некорректно работает скетч!]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=372</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=372&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Некорректно работает скетч!.]]></description>
		<lastBuildDate>Sun, 28 Jan 2018 19:22:29 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Некорректно работает скетч!]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1289#p1289</link>
			<description><![CDATA[<p>спасибо огромное)))) капал совсем в другую сторону)))<br />все заработало азы азов))</p>]]></description>
			<author><![CDATA[null@example.com (alim62)]]></author>
			<pubDate>Sun, 28 Jan 2018 19:22:29 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1289#p1289</guid>
		</item>
		<item>
			<title><![CDATA[Re: Некорректно работает скетч!]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1286#p1286</link>
			<description><![CDATA[<p>Ответ на ваш вопрос есть в описании библиотеки servo.h,<br />например тут <a target="_blank" href="http://arduino.ru/Reference/Library/Servo">http://arduino.ru/Reference/Library/Servo</a><br />На контроллерах отличных от Mega использование библиотеки отключает возможность использовать выходы 9 и 10 в режиме ШИМ даже если привод не подключен к этим выводам.</p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Sun, 28 Jan 2018 17:48:13 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1286#p1286</guid>
		</item>
		<item>
			<title><![CDATA[Re: Некорректно работает скетч!]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1285#p1285</link>
			<description><![CDATA[<p>пробовал и так тоже, а мб что то с hm10?</p>]]></description>
			<author><![CDATA[null@example.com (alim62)]]></author>
			<pubDate>Sun, 28 Jan 2018 14:18:31 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1285#p1285</guid>
		</item>
		<item>
			<title><![CDATA[Re: Некорректно работает скетч!]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1284#p1284</link>
			<description><![CDATA[<p>В скетче вижу только одну севу, а где вторая, или из за нее все и сбоит?, А вообще попробуй управление слайдером изменить</p><p>int8_t strela; // =-100..100 положение слайдера -&nbsp; на от 0 до 100<br />int8_t kovsh; // =-100..100 положение слайдера - на от 0 до 100</p>]]></description>
			<author><![CDATA[null@example.com (olegeglit)]]></author>
			<pubDate>Sun, 28 Jan 2018 13:16:16 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1284#p1284</guid>
		</item>
		<item>
			<title><![CDATA[Re: Некорректно работает скетч!]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1282#p1282</link>
			<description><![CDATA[<p>пробовал не получается, если подключать все отдельно(разными скетчами) то работает нормально! а вместе не хочет(((</p>]]></description>
			<author><![CDATA[null@example.com (alim62)]]></author>
			<pubDate>Sun, 28 Jan 2018 10:35:32 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1282#p1282</guid>
		</item>
		<item>
			<title><![CDATA[Re: Некорректно работает скетч!]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1281#p1281</link>
			<description><![CDATA[<p>Возможно вам поможет эта информация<br /><a target="_blank" href="http://forum.remotexy.com/viewtopic.php?id=9">http://forum.remotexy.com/viewtopic.php?id=9</a></p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Sun, 28 Jan 2018 07:09:47 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1281#p1281</guid>
		</item>
		<item>
			<title><![CDATA[Некорректно работает скетч!]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1280#p1280</link>
			<description><![CDATA[<p>Добрый день, не могу понять почему при добавлении настроек сервоприводов скетч перестает адекватно работать?<br />Плата arduino pro mini и bluetooth HM-10<br />Скетч для погрузчика на две сервы и два мотора</p><br /><br /><p>////////////////////////////////////////////// <br />//&nbsp; &nbsp; &nbsp; &nbsp; RemoteXY include library&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // <br />////////////////////////////////////////////// </p><p>// определение режима соединения и подключение библиотеки RemoteXY&nbsp; <br />#define REMOTEXY_MODE__SOFTSERIAL<br />#include &lt;SoftwareSerial.h&gt; <br />#include &lt;Servo.h&gt; <br />#include &lt;RemoteXY.h&gt; </p><p>// настройки соединения&nbsp; <br />#define REMOTEXY_SERIAL_RX 16 <br />#define REMOTEXY_SERIAL_TX 3 <br />#define REMOTEXY_SERIAL_SPEED 9600 </p><br /><p>// конфигурация интерфейса&nbsp; &nbsp;<br />#pragma pack(push, 1) <br />uint8_t RemoteXY_CONF[] = <br />&nbsp; { 255,7,0,0,0,217,0,8,79,0,<br />&nbsp; 5,32,52,13,47,47,2,26,19,4,<br />&nbsp; 48,3,11,9,51,89,26,4,48,17,<br />&nbsp; 11,9,51,89,26,2,0,31,31,19,<br />&nbsp; 8,2,26,31,31,79,78,0,79,70,<br />&nbsp; 70,0,2,0,31,16,19,8,2,26,<br />&nbsp; 31,31,79,78,0,79,70,70,0,2,<br />&nbsp; 0,31,47,19,8,2,26,31,31,79,<br />&nbsp; 78,0,79,70,70,0,129,0,30,11,<br />&nbsp; 20,4,1,208,147,208,176,208,177,208,<br />&nbsp; 176,209,128,208,184,209,130,209,139,0,<br />&nbsp; 129,0,31,25,19,4,1,208,144,208,<br />&nbsp; 178,208,176,209,128,208,184,208,185,208,<br />&nbsp; 186,208,176,0,129,0,28,41,25,4,<br />&nbsp; 1,208,158,209,133,208,187,208,176,208,<br />&nbsp; 182,208,180,208,181,208,189,208,184,208,<br />&nbsp; 181,0,129,0,26,0,46,9,64,208,<br />&nbsp; 159,208,190,208,179,209,128,209,131,208,<br />&nbsp; 183,209,135,208,184,208,186,0,129,0,<br />&nbsp; 2,9,11,3,36,208,161,209,130,209,<br />&nbsp; 128,208,181,208,187,208,176,0,129,0,<br />&nbsp; 15,9,8,3,36,208,154,208,190,208,<br />&nbsp; 178,209,136,0 }; <br />&nbsp; &nbsp;<br />// структура определяет все переменные вашего интерфейса управления&nbsp; <br />struct { </p><p>&nbsp; &nbsp; // input variable<br />&nbsp; int8_t joystick_1_x; // =-100..100 координата x положения джойстика <br />&nbsp; int8_t joystick_1_y; // =-100..100 координата y положения джойстика <br />&nbsp; int8_t strela; // =-100..100 положение слайдера <br />&nbsp; int8_t kovsh; // =-100..100 положение слайдера <br />&nbsp; uint8_t avar; // =1 если переключатель включен и =0 если отключен <br />&nbsp; uint8_t gabariti; // =1 если переключатель включен и =0 если отключен <br />&nbsp; uint8_t cooler; // =1 если переключатель включен и =0 если отключен </p><p>&nbsp; &nbsp; // other variable<br />&nbsp; uint8_t connect_flag;&nbsp; // =1 if wire connected, else =0 </p><p>} RemoteXY; <br />#pragma pack(pop) </p><p>///////////////////////////////////////////// <br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END RemoteXY include&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // <br />///////////////////////////////////////////// </p><p>/* определяем пины управления правым мотором */ <br />#define PIN_MOTOR_RIGHT_UP 7 <br />#define PIN_MOTOR_RIGHT_DN 6 <br />#define PIN_MOTOR_RIGHT_SPEED 10 </p><p>/* определяем пины управления левым мотором */ <br />#define PIN_MOTOR_LEFT_UP 5 <br />#define PIN_MOTOR_LEFT_DN 4 <br />#define PIN_MOTOR_LEFT_SPEED 9 </p><p>#define PIN_AVAR A3<br />#define PIN_GABARITI 13<br />#define PIN_COOLER A5</p><p>Servo myservo; </p><br /><p>/* определяем два массива с перечислением пинов для каждого мотора */ <br />unsigned char RightMotor[3] =&nbsp; <br />&nbsp; {PIN_MOTOR_RIGHT_UP, PIN_MOTOR_RIGHT_DN, PIN_MOTOR_RIGHT_SPEED}; <br />unsigned char LeftMotor[3] =&nbsp; <br />&nbsp; {PIN_MOTOR_LEFT_UP, PIN_MOTOR_LEFT_DN, PIN_MOTOR_LEFT_SPEED}; </p><p>/* <br />&nbsp; &nbsp;управление скоростью мотора <br />&nbsp; &nbsp;motor - ссылка на массив пинов <br />&nbsp; &nbsp;v - скорость мотора, может принимать значения от -100 до 100 <br />*/ <br />void Wheel (unsigned char * motor, int v) <br />{ <br />&nbsp; if (v&gt;100) v=100; <br />&nbsp; if (v&lt;-100) v=-100; <br />&nbsp; if (v&gt;0) { <br />&nbsp; &nbsp; digitalWrite(motor[0], HIGH); <br />&nbsp; &nbsp; digitalWrite(motor[1], LOW); <br />&nbsp; &nbsp; analogWrite(motor[2], v*2.55); <br />&nbsp; } <br />&nbsp; else if (v&lt;0) { <br />&nbsp; &nbsp; digitalWrite(motor[0], LOW); <br />&nbsp; &nbsp; digitalWrite(motor[1], HIGH); <br />&nbsp; &nbsp; analogWrite(motor[2], (-v)*2.55); <br />&nbsp; } <br />&nbsp; else { <br />&nbsp; &nbsp; digitalWrite(motor[0], LOW); <br />&nbsp; &nbsp; digitalWrite(motor[1], LOW); <br />&nbsp; &nbsp; analogWrite(motor[2], 0); <br />&nbsp; } <br />} <br />void setup()&nbsp; <br />{ <br />&nbsp; RemoteXY_Init (); <br />&nbsp; &nbsp;<br />&nbsp; myservo.attach(11);&nbsp; <br />&nbsp; RemoteXY.kovsh = 80;<br />&nbsp; <br /> /* инициализация пинов */ <br />&nbsp; pinMode (PIN_MOTOR_RIGHT_UP, OUTPUT); <br />&nbsp; pinMode (PIN_MOTOR_RIGHT_DN, OUTPUT); <br />&nbsp; pinMode (PIN_MOTOR_LEFT_UP, OUTPUT); <br />&nbsp; pinMode (PIN_MOTOR_LEFT_DN, OUTPUT); <br />&nbsp; pinMode (PIN_AVAR, OUTPUT);<br />&nbsp; pinMode (PIN_GABARITI, OUTPUT);<br />&nbsp; pinMode (PIN_COOLER, OUTPUT);<br />&nbsp; &nbsp;<br />&nbsp; // TODO you setup code <br />&nbsp; &nbsp;<br />} </p><p>void loop()&nbsp; <br />{&nbsp; <br />&nbsp; RemoteXY_Handler (); <br />&nbsp; &nbsp;<br />&nbsp; digitalWrite(PIN_AVAR, (RemoteXY.avar==0)?LOW:HIGH);<br />&nbsp; digitalWrite(PIN_GABARITI, (RemoteXY.gabariti==0)?LOW:HIGH);<br />&nbsp; digitalWrite(PIN_COOLER, (RemoteXY.cooler==0)?LOW:HIGH);<br />&nbsp; &nbsp;<br /> /* управляем правым мотором */ <br />&nbsp; Wheel (RightMotor, RemoteXY.joystick_1_y - RemoteXY.joystick_1_x); <br />&nbsp; /* управляем левым мотором */ <br />&nbsp; Wheel (LeftMotor, RemoteXY.joystick_1_y + RemoteXY.joystick_1_x); </p><br /><p>int ms = RemoteXY.kovsh;&nbsp; <br />&nbsp; ms = map(ms, 0, 100, 50, 100); <br />&nbsp; myservo.write(ms);&nbsp; </p><p>}</p>]]></description>
			<author><![CDATA[null@example.com (alim62)]]></author>
			<pubDate>Sun, 28 Jan 2018 01:23:51 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1280#p1280</guid>
		</item>
	</channel>
</rss>
