<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Using joystick to control servo motor]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=563</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=563&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Using joystick to control servo motor.]]></description>
		<lastBuildDate>Mon, 03 Sep 2018 14:51:36 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Using joystick to control servo motor]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1778#p1778</link>
			<description><![CDATA[<p>If you post ALL of your code, I can take a look at why your servo is not moving, perhaps you&#039;ve missed an important step...</p>]]></description>
			<author><![CDATA[null@example.com (Daba)]]></author>
			<pubDate>Mon, 03 Sep 2018 14:51:36 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1778#p1778</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using joystick to control servo motor]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1775#p1775</link>
			<description><![CDATA[<div class="quotebox"><cite>Daba wrote:</cite><blockquote><p>Not clear from your original post, but do you want the servo to move to a new commanded position, or do you want continuous rotation of the servo until the joystick is centered again ??</p><p>A &quot;servo&quot; will just move to the new position and stop. </p><p>You can make a servo rotate continuously, by removing the feedback potentiometer inside it and replacing it with two resistors, same value, where the potentiometer was.&nbsp; I prefer to put a 20-turn potentiometer in instead of the two fixed resitors, because then I can trim the servo to stop when I PWM 1500 uS to it.&nbsp; There will also likely be a physical stop which will also need to be removed.&nbsp; The speed the servo will go will be dependent upon how far the joystick is moved from centre.</p><p>If you only want Left/Right (x-axis), why not just use a horizontal slider ....</p></blockquote></div><p>Thank You So Much for your detailed reply.</p><p>I wanted it to move clockwise and anticlockwise with respect to one static postion. But, when I set 90° as the initial position of the servo and then change it&#039;s value into 0° when Joystick moved left and 180° when Joystick moved right. But, when I use </p><div class="codebox"><pre><code>myservo.write(0)</code></pre></div><p> for it, it just simply doesn&#039;t move in any direction.</p><p>This is the main problem.</p><p>I also tried with horizontal slider. But, again the servo doesn&#039;t move at all when I move the slider towards left side and only moves when I slide it towards right.</p><p>I used the code for horizontal slider which is given in the examples of the website and I also replaced the pin from 13 to 3 as you suggested.</p><p>Actually I am installing a WiFi action camera into my Bluetooth controlled robot. I wanna Install it on the servo, so that whenever o would need to see right or left side of the robot, I could move the camera without touching it.</p><br /><p>Thanks in advance for any further help.<br />Your support is always appreciated by me.</p>]]></description>
			<author><![CDATA[null@example.com (naved.the.sheikh)]]></author>
			<pubDate>Sun, 02 Sep 2018 15:55:24 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1775#p1775</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using joystick to control servo motor]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1774#p1774</link>
			<description><![CDATA[<p>Not clear from your original post, but do you want the servo to move to a new commanded position, or do you want continuous rotation of the servo until the joystick is centered again ??</p><p>A &quot;servo&quot; will just move to the new position and stop. </p><p>You can make a servo rotate continuously, by removing the feedback potentiometer inside it and replacing it with two resistors, same value, where the potentiometer was.&nbsp; I prefer to put a 20-turn potentiometer in instead of the two fixed resitors, because then I can trim the servo to stop when I PWM 1500 uS to it.&nbsp; There will also likely be a physical stop which will also need to be removed.&nbsp; The speed the servo will go will be dependent upon how far the joystick is moved from centre.</p><p>If you only want Left/Right (x-axis), why not just use a horizontal slider ....</p>]]></description>
			<author><![CDATA[null@example.com (Daba)]]></author>
			<pubDate>Sun, 02 Sep 2018 13:54:49 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1774#p1774</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using joystick to control servo motor]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1772#p1772</link>
			<description><![CDATA[<p>Thank You So Much. I&#039;ll contact you again as soon as I try this method out.</p>]]></description>
			<author><![CDATA[null@example.com (naved.the.sheikh)]]></author>
			<pubDate>Sun, 02 Sep 2018 07:35:47 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1772#p1772</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using joystick to control servo motor]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1771#p1771</link>
			<description><![CDATA[<p>You cannot use pin 13 for a PWM Servo output, it is not a PWM pin.</p><p>Only pins 3, 5, 6, 9, 10, and 11 are PWM that can be attached to the Servo library.</p><p>Once you have attached a PWM output pin to your servo instance, an analogWrite() of 0 to 255 to the digital pin makes it PWM.</p>]]></description>
			<author><![CDATA[null@example.com (Daba)]]></author>
			<pubDate>Sun, 02 Sep 2018 07:21:14 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1771#p1771</guid>
		</item>
		<item>
			<title><![CDATA[Using joystick to control servo motor]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1769#p1769</link>
			<description><![CDATA[<p>Hello guys!</p><p>I am stuck into a problem. I want to use a virtual joystick (obviously from RemoteXY) to control the directional angular motion/movement of my servo.</p><p>I&#039;ve tried coding multiple times to get my desired job done. But, every time something is left insignificant or wrong. Therefore I cannot control it through the joystick, how I actually want.</p><p>I want to control my servo as:- 1). It should rotate clockwise when I swipe to the positive x-axis of Joystick (exact same for <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;positive y-axis) and<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2). It should rotate anticlockwise when I swipe towards the negative x-axis of the joystick. (exact <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;same for negative y-axis)</p><p>I&#039;ve attached the servo to Pin No. 13 (All other pins except Analogue ones are already reserved).</p><br /><p>The Raw Code of my project (without any interference of mine) is below, please check and improve the same, Please <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /> :-</p><br /><div class="codebox"><pre><code>/* 
   -- New project -- 
    
   This source code of graphical user interface  
   has been generated automatically by RemoteXY editor. 
   To compile this code using RemoteXY library 2.3.3 or later version  
   download by link http://remotexy.com/en/library/ 
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                    
     - for ANDROID 4.1.1 or later version; 
     - for iOS 1.2.1 or later version; 
     
   This source code is free software; you can redistribute it and/or 
   modify it under the terms of the GNU Lesser General Public 
   License as published by the Free Software Foundation; either 
   version 2.1 of the License, or (at your option) any later version.     
*/ 

////////////////////////////////////////////// 
//        RemoteXY include library          // 
////////////////////////////////////////////// 

// RemoteXY select connection mode and include library  
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT

#include &lt;RemoteXY.h&gt; 

// Include the Servo library 

#include &lt;Servo.h&gt; 

// Declare the Servo pin 

int servoPin = 13; 

// Create a servo object 

Servo Servo1; 

// RemoteXY connection settings  
#define REMOTEXY_SERIAL Serial 
#define REMOTEXY_SERIAL_SPEED 115200 
#define REMOTEXY_WIFI_SSID &quot;Servo control &quot; 
#define REMOTEXY_WIFI_PASSWORD &quot;&quot; 
#define REMOTEXY_SERVER_PORT 6377 


// RemoteXY configurate   
#pragma pack(push, 1) 
uint8_t RemoteXY_CONF[] = 
  { 255,2,0,0,0,12,0,8,13,0,
  5,19,29,7,46,46,2,26,31 }; 
   
// this structure defines all the variables of your control interface  
struct { 

    // input variable
  int8_t joystick_1_x; // =-100..100 x-coordinate joystick position 
  int8_t joystick_1_y; // =-100..100 y-coordinate joystick position 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY; 
#pragma pack(pop) 

///////////////////////////////////////////// 
//           END RemoteXY include          // 
///////////////////////////////////////////// 



void setup()  
{ 
  RemoteXY_Init ();  
   
  // We need to attach the servo to the used pin number 

   Servo1.attach(servoPin);
   
  // TODO you setup code 
   
} 

void loop()  
{  
  RemoteXY_Handler (); 
   
  // I&#039;ve erased all my garbage from here. So, that you could concentrate easily :D. Thank You So much for taking interest. 
   
  // TODO you loop code 
  // use the RemoteXY structure for data transfer 


}</code></pre></div><br /><p>I am a newbie. I love these kind of things and Internet and you people are only teacher of mine in this subject. I learn from you only and I don&#039;t have any other means to learn these things. Please please please support and help me. I&#039;ll always be grateful to you.<br />I appreciate your efforts of caring such new children in robotics like me.</p><br /><p>Thank You So Much in Advance!!!</p><p>Have a nice Day</p>]]></description>
			<author><![CDATA[null@example.com (naved.the.sheikh)]]></author>
			<pubDate>Sat, 01 Sep 2018 12:10:54 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1769#p1769</guid>
		</item>
	</channel>
</rss>
