<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — The G-sensor element "joystick" and slider conflict.]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=332&amp;type=atom" />
	<updated>2017-12-24T06:15:42Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=332</id>
		<entry>
			<title type="html"><![CDATA[Re: The G-sensor element "joystick" and slider conflict.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1191#p1191" />
			<content type="html"><![CDATA[<p>Do not use libraries at the same time such as SoftwareSerial.x and Servo.h<br />If you use Servo.h then you must use HardwareSerial in RemoteXY</p>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2017-12-24T06:15:42Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1191#p1191</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The G-sensor element "joystick" and slider conflict.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1159#p1159" />
			<content type="html"><![CDATA[<p>Hello, Her is my code. When I trying to move the car with joystick the slider move with no control and no reaction to joystick .&nbsp; And after a while no connecting to smartphone . I do not know where is the error. If I remove the slider then the robot car will Work with no problem. Please help! I am using HC-05 bluetooth.</p><p>/* <br />&nbsp; &nbsp; -- Robotslider33 -- <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; This source code of graphical user interface&nbsp; <br />&nbsp; &nbsp; has been generated automatically by RemoteXY editor. <br />&nbsp; &nbsp; To compile this code using RemoteXY library 2.3.3 or later version&nbsp; <br />&nbsp; &nbsp; download by link <a target="_blank" href="http://remotexy.com/en/library/">http://remotexy.com/en/library/</a> <br />&nbsp; &nbsp; To connect using RemoteXY mobile app by link <a target="_blank" href="http://remotexy.com/en/download/">http://remotexy.com/en/download/</a>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; - for ANDROID 4.1.1 or later version; <br />&nbsp; &nbsp; &nbsp; - for iOS 1.2.1 or later version; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; This source code is free software; you can redistribute it and/or <br />&nbsp; &nbsp; modify it under the terms of the GNU Lesser General Public <br />&nbsp; &nbsp; License as published by the Free Software Foundation; either <br />&nbsp; &nbsp; version 2.1 of the License, or (at your option) any later version.&nbsp; &nbsp; &nbsp;<br /> */ </p><p> ////////////////////////////////////////////// <br /> //&nbsp; &nbsp; &nbsp; &nbsp; RemoteXY include library&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // <br /> ////////////////////////////////////////////// </p><p> // RemoteXY select connection mode and include library&nbsp; <br /> #define REMOTEXY_MODE__SOFTSERIAL<br /> #include &lt;SoftwareSerial.h&gt; </p><p> #include &lt;RemoteXY.h&gt; </p><p> #include &lt;Servo.h&gt;<br /> Servo myservo;</p><p> // RemoteXY connection settings&nbsp; <br /> #define REMOTEXY_SERIAL_RX 2 <br /> #define REMOTEXY_SERIAL_TX 3 <br /> #define REMOTEXY_SERIAL_SPEED 9600 </p><br /><p> // RemoteXY configurate&nbsp; &nbsp;<br /> #pragma pack(push, 1) <br /> uint8_t RemoteXY_CONF[] = <br />&nbsp; &nbsp;{ 255,4,0,0,0,37,0,8,13,0,<br />&nbsp; &nbsp;5,49,60,10,30,30,1,26,31,2,<br />&nbsp; &nbsp;0,25,7,22,11,2,26,31,31,79,<br />&nbsp; &nbsp;78,0,79,70,70,0,4,0,9,14,<br />&nbsp; &nbsp;7,41,2,26 }; <br />&nbsp; &nbsp; <br /> // this structure defines all the variables of your control interface&nbsp; <br /> struct { </p><p>&nbsp; &nbsp; &nbsp;// input variable<br />&nbsp; &nbsp;int8_t joystick_1_x; // =-100..100 x-coordinate joystick position <br />&nbsp; &nbsp;int8_t joystick_1_y; // =-100..100 y-coordinate joystick position <br />&nbsp; &nbsp;uint8_t switch_1; // =1 if switch ON and =0 if OFF <br />&nbsp; &nbsp;int8_t slider_1; // =0..100 slider position </p><p>&nbsp; &nbsp; &nbsp;// other variable<br />&nbsp; &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> #define PIN_SWITCH_1 12</p><p> /* defined the right motor control pins */ <br /> #define PIN_MOTOR_RIGHT_UP 7 <br /> #define PIN_MOTOR_RIGHT_DN 6 <br /> #define PIN_MOTOR_RIGHT_SPEED 10 </p><p> /* defined the left motor control pins */ <br /> #define PIN_MOTOR_LEFT_UP 5 <br /> #define PIN_MOTOR_LEFT_DN 4 <br /> #define PIN_MOTOR_LEFT_SPEED 9 </p><p> /* defined two arrays with a list of pins for each motor */ <br /> unsigned char RightMotor[3] =&nbsp; <br />&nbsp; &nbsp;{PIN_MOTOR_RIGHT_UP, PIN_MOTOR_RIGHT_DN, PIN_MOTOR_RIGHT_SPEED}; <br /> unsigned char LeftMotor[3] =&nbsp; <br />&nbsp; &nbsp;{PIN_MOTOR_LEFT_UP, PIN_MOTOR_LEFT_DN, PIN_MOTOR_LEFT_SPEED}; <br /> /* <br />&nbsp; &nbsp; speed control of the motor <br />&nbsp; &nbsp; motor - pointer to an array of pins <br />&nbsp; &nbsp; v - motor speed can be set from -100 to 100 <br /> */ <br /> void Wheel (unsigned char * motor, int v) <br /> { <br />&nbsp; &nbsp;if (v&gt;100) v=100; <br />&nbsp; &nbsp;if (v&lt;-100) v=-100; <br />&nbsp; &nbsp;if (v&gt;0) { <br />&nbsp; &nbsp; &nbsp;digitalWrite(motor[0], HIGH); <br />&nbsp; &nbsp; &nbsp;digitalWrite(motor[1], LOW); <br />&nbsp; &nbsp; &nbsp;analogWrite(motor[2], v*2.55); <br />&nbsp; &nbsp;} <br />&nbsp; &nbsp;else if (v&lt;0) { <br />&nbsp; &nbsp; &nbsp;digitalWrite(motor[0], LOW); <br />&nbsp; &nbsp; &nbsp;digitalWrite(motor[1], HIGH); <br />&nbsp; &nbsp; &nbsp;analogWrite(motor[2], (-v)*2.55); <br />&nbsp; &nbsp;} <br />&nbsp; &nbsp;else { <br />&nbsp; &nbsp; &nbsp;digitalWrite(motor[0], LOW); <br />&nbsp; &nbsp; &nbsp;digitalWrite(motor[1], LOW); <br />&nbsp; &nbsp; &nbsp;analogWrite(motor[2], 0); <br />&nbsp; &nbsp;} <br /> } </p> <br /><br /><p> void setup()&nbsp; <br /> { <br />&nbsp; &nbsp;RemoteXY_Init ();&nbsp; <br />&nbsp; &nbsp; /* initialization pins */ <br />&nbsp; &nbsp;pinMode (PIN_MOTOR_RIGHT_UP, OUTPUT); <br />&nbsp; &nbsp;pinMode (PIN_MOTOR_RIGHT_DN, OUTPUT); <br />&nbsp; &nbsp;pinMode (PIN_MOTOR_LEFT_UP, OUTPUT); <br />&nbsp; &nbsp;pinMode (PIN_MOTOR_LEFT_DN, OUTPUT); <br />&nbsp; &nbsp; <br />&nbsp; &nbsp;pinMode (PIN_SWITCH_1, OUTPUT);</p><p>&nbsp; myservo.attach(11);<br />&nbsp; RemoteXY.slider_1 = 50;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;// TODO you setup code <br />&nbsp; &nbsp; <br /> } </p><p> void loop()&nbsp; <br /> {&nbsp; <br />&nbsp; &nbsp;RemoteXY_Handler (); <br />&nbsp; &nbsp; <br />&nbsp; // TODO you loop code <br />&nbsp; &nbsp;// use the RemoteXY structure for data transfer <br />&nbsp; &nbsp; digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);</p><p>&nbsp; &nbsp; /* manage the right motor */ <br />&nbsp; &nbsp;Wheel (RightMotor, RemoteXY.joystick_1_y - RemoteXY.joystick_1_x); <br />&nbsp; &nbsp;/* manage the left motor */ <br />&nbsp; &nbsp;Wheel (LeftMotor, RemoteXY.joystick_1_y + RemoteXY.joystick_1_x); <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;int ms = RemoteXY.slider_1*20+500;<br />&nbsp; &nbsp;myservo.writeMicroseconds(ms); </p><br /><p> }</p>]]></content>
			<author>
				<name><![CDATA[Salam22]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=488</uri>
			</author>
			<updated>2017-12-16T11:10:05Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1159#p1159</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The G-sensor element "joystick" and slider conflict.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1152#p1152" />
			<content type="html"><![CDATA[<p>Hello. Possibly your code have any error. Please write your code here</p>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2017-12-15T06:38:59Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1152#p1152</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[The G-sensor element "joystick" and slider conflict.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1146#p1146" />
			<content type="html"><![CDATA[<p>I build your example remote control robot platform with two DC motors car with the element &quot;joystick” and one LED &quot;on off&quot;. This work perfectly with your example you note in your Examples of Arduino projects.<br />But in my project I try to add in editor a slider connected to servo motor with G-sensor element which is driving the car. It did not work in my project. There was a conflict when I run it. There was interfacing problems between &quot;joystick&quot; G-sensor and slider. It should both work independently with each other. may be you have an example to show how robot car work with a slider?&nbsp; please help! Thank you.</p>]]></content>
			<author>
				<name><![CDATA[Salam22]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=488</uri>
			</author>
			<updated>2017-12-13T17:07:12Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1146#p1146</id>
		</entry>
</feed>
