<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Lessen the sensitivity of the Virtual Joystick]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=535</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=535&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Lessen the sensitivity of the Virtual Joystick.]]></description>
		<lastBuildDate>Tue, 31 Jul 2018 11:47:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Lessen the sensitivity of the Virtual Joystick]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1733#p1733</link>
			<description><![CDATA[<p>May you please please Help me in this one too</p><p><a target="_blank" href="http://forum.remotexy.com/viewtopic.php?id=542">http://forum.remotexy.com/viewtopic.php?id=542</a></p><p>It&#039;ll be so great of you. </p>]]></description>
			<author><![CDATA[null@example.com (naved.the.sheikh)]]></author>
			<pubDate>Tue, 31 Jul 2018 11:47:03 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1733#p1733</guid>
		</item>
		<item>
			<title><![CDATA[Re: Lessen the sensitivity of the Virtual Joystick]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1732#p1732</link>
			<description><![CDATA[<div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>Here is a function that will check if the joystick is inside the dead zone</p><div class="codebox"><pre><code>int8_t checkDeadZone( int8_t joystickValue, uint8_t deadZone )
{
    if ( joystickValue &lt; deadZone &amp;&amp; joystickValue &gt; -deadZone )
        return 0;
        
    if ( joystickValue &lt; 0 )
        return map( joystickValue, -deadZone, -100, 0, -100 );
        
    return map( joystickValue, deadZone, 100, 0, 100 );
}</code></pre></div><br /><p>Use like this, for example:</p><div class="codebox"><pre><code>void Wheel (uint8_t * motor, int v) // v = motor speed, motor = pointer to an array of pins 
{
  if (v &gt; 100) v=100;
  if (v &lt; -100) v=-100;

  v = checkDeadZone( v, 20 );

  v = ease( v );

  ...</code></pre></div><br /><br /><p>Also your motors may need a different easing curve.</p><p><span class="postimg"><img src="http://postfiles13.naver.net/20160212_140/saya83_1455244283930vRjIl_PNG/K-52.png?type=w3" alt="http://postfiles13.naver.net/20160212_140/saya83_1455244283930vRjIl_PNG/K-52.png?type=w3" /></span><br />My &#039;ease&#039; function will result as a curve like &quot;easeInQuad&quot; in the above picture, but you may want to try another one such as &quot;easeOutCubic&quot; !</p></blockquote></div><p>Thank You So Much. You taught me today an all new thing.<br />You seem to be an expert.</p>]]></description>
			<author><![CDATA[null@example.com (naved.the.sheikh)]]></author>
			<pubDate>Tue, 31 Jul 2018 11:44:10 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1732#p1732</guid>
		</item>
		<item>
			<title><![CDATA[Re: Lessen the sensitivity of the Virtual Joystick]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1724#p1724</link>
			<description><![CDATA[<p>Here is a function that will check if the joystick is inside the dead zone</p><div class="codebox"><pre><code>int8_t checkDeadZone( int8_t joystickValue, uint8_t deadZone )
{
    if ( joystickValue &lt; deadZone &amp;&amp; joystickValue &gt; -deadZone )
        return 0;
        
    if ( joystickValue &lt; 0 )
        return map( joystickValue, -deadZone, -100, 0, -100 );
        
    return map( joystickValue, deadZone, 100, 0, 100 );
}</code></pre></div><br /><p>Use like this, for example:</p><div class="codebox"><pre><code>void Wheel (uint8_t * motor, int v) // v = motor speed, motor = pointer to an array of pins 
{
  if (v &gt; 100) v=100;
  if (v &lt; -100) v=-100;

  v = checkDeadZone( v, 20 );

  v = ease( v );

  ...</code></pre></div><br /><br /><p>Also your motors may need a different easing curve.</p><p><span class="postimg"><img src="http://jb.demonte.fr/blog/wp-content/uploads/2012/12/easing.png" alt="http://jb.demonte.fr/blog/wp-content/uploads/2012/12/easing.png" /></span><br />My &#039;ease&#039; function will result as a curve like &quot;easeInQuad&quot; in the above picture, but you may want to try another one such as &quot;easeOutCubic&quot; !</p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Mon, 30 Jul 2018 15:37:36 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1724#p1724</guid>
		</item>
		<item>
			<title><![CDATA[Re: Lessen the sensitivity of the Virtual Joystick]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1722#p1722</link>
			<description><![CDATA[<div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>What you need is probably a dead zone near the center of joystick</p></blockquote></div><p>Probably.<br />But I couldn&#039;t precisely understand the meaning of vocabulary &quot;dead-zone&quot;. </p><p>Even I&#039;m unable to say clearly what I Want.</p>]]></description>
			<author><![CDATA[null@example.com (naved.the.sheikh)]]></author>
			<pubDate>Mon, 30 Jul 2018 14:24:09 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1722#p1722</guid>
		</item>
		<item>
			<title><![CDATA[Re: Lessen the sensitivity of the Virtual Joystick]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1721#p1721</link>
			<description><![CDATA[<p>What you need is probably a dead zone near the center of joystick</p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Mon, 30 Jul 2018 14:00:03 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1721#p1721</guid>
		</item>
		<item>
			<title><![CDATA[Re: Lessen the sensitivity of the Virtual Joystick]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1720#p1720</link>
			<description><![CDATA[<div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>Add that little function inside your code, then modify the begining of your Wheel function like so:</p><div class="codebox"><pre><code>void Wheel (uint8_t * motor, int v) // v = motor speed, motor = pointer to an array of pins 
{
  if (v &gt; 100) v=100;
  if (v &lt; -100) v=-100;

  v = ease( v ); // just add this line

  ...</code></pre></div><br /><p>Also, these lines doesn&#039;t make much sense to me:<br /></p><div class="codebox"><pre><code>Wheel (RightMotor, RemoteXY.joystick_1_y - RemoteXY.joystick_1_x);
Wheel (LeftMotor, RemoteXY.joystick_1_y + RemoteXY.joystick_1_x);</code></pre></div></blockquote></div><br /><p>Thank You So Much Sir for giving me your valuable time.<br />Although this code worked for me, I found out my decision to lessen or decrease the sensitivity was not a good idea.</p>]]></description>
			<author><![CDATA[null@example.com (naved.the.sheikh)]]></author>
			<pubDate>Mon, 30 Jul 2018 11:57:02 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1720#p1720</guid>
		</item>
		<item>
			<title><![CDATA[Re: Lessen the sensitivity of the Virtual Joystick]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1719#p1719</link>
			<description><![CDATA[<p>Add that little function inside your code, then modify the begining of your Wheel function like so:</p><div class="codebox"><pre><code>void Wheel (uint8_t * motor, int v) // v = motor speed, motor = pointer to an array of pins 
{
  if (v &gt; 100) v=100;
  if (v &lt; -100) v=-100;

  v = ease( v ); // just add this line

  ...</code></pre></div><br /><p>Also, these lines doesn&#039;t make much sense to me:<br /></p><div class="codebox"><pre><code>Wheel (RightMotor, RemoteXY.joystick_1_y - RemoteXY.joystick_1_x);
Wheel (LeftMotor, RemoteXY.joystick_1_y + RemoteXY.joystick_1_x);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Mon, 30 Jul 2018 09:18:11 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1719#p1719</guid>
		</item>
		<item>
			<title><![CDATA[Re: Lessen the sensitivity of the Virtual Joystick]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1718#p1718</link>
			<description><![CDATA[<div class="quotebox"><cite>Guillaume wrote:</cite><blockquote><p>Maybe use an easing function for the raw joystick value, for example:<br /></p><div class="codebox"><pre><code>int8_t ease( int8_t in )
{
    int8_t out = ( in * in ) / 100;
    return in &gt;= 0 ? out : -out;
}</code></pre></div></blockquote></div><p> Please elaborate it.<br />I am very new to Arduino IDE and specially GUI(s).<br />It would be so great if you modify the aforementioned code in the format which you told me.</p><p>I&#039;ll be so grateful to you </p>]]></description>
			<author><![CDATA[null@example.com (naved.the.sheikh)]]></author>
			<pubDate>Sun, 29 Jul 2018 19:06:53 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1718#p1718</guid>
		</item>
		<item>
			<title><![CDATA[Re: Lessen the sensitivity of the Virtual Joystick]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1717#p1717</link>
			<description><![CDATA[<p>Maybe use an easing function for the raw joystick value, for example:<br /></p><div class="codebox"><pre><code>int8_t ease( int8_t in )
{
    int8_t out = ( in * in ) / 100;
    return in &gt;= 0 ? out : -out;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Sun, 29 Jul 2018 17:23:03 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1717#p1717</guid>
		</item>
		<item>
			<title><![CDATA[Lessen the sensitivity of the Virtual Joystick]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=1716#p1716</link>
			<description><![CDATA[<p>Hey there!<br />I am using the customized GUI powered by RemoteXY for controlling my Robo Car using L298N DC Motor Driver and HC-05 Bluetooth module with arduino.<br />I use the Joystick to move my Car. Whenever a slight change is observed by the Joystick of the GUI it starts moving on that respective direction .<br />Because of that I am unable to move my car on a straight path.<br />Please someone tell me, how to decrease the sensitivity of the Joystick.</p><p>The code I&#039;m using:-</p><div class="codebox"><pre><code>/* 
   -- 1st Robo Car Project (2) with horn(1) -- 
    
   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 [url]http://remotexy.com/en/library/[/url]
   To connect using RemoteXY mobile app by link [url]http://remotexy.com/en/download/[/url]                   
     - 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__SOFTSERIAL
#include &lt;SoftwareSerial.h&gt; 

#include &lt;RemoteXY.h&gt; 

// RemoteXY connection settings  
#define REMOTEXY_SERIAL_RX 2 
#define REMOTEXY_SERIAL_TX 3 
#define REMOTEXY_SERIAL_SPEED 9600 


// RemoteXY configurate   
#pragma pack(push, 1) 
uint8_t RemoteXY_CONF[] = 
  { 255,9,0,0,0,154,0,8,228,4,
  5,48,44,26,30,30,0,31,8,1,
  6,0,-84,-142,20,20,0,2,26,2,
  1,2,1,22,11,0,135,26,16,1,
  79,78,0,79,70,70,0,129,0,5,
  24,23,8,0,64,78,97,118,101,100,
  0,131,3,51,1,20,5,1,2,31,
  82,111,98,111,116,32,67,97,114,0,
  131,0,62,5,19,5,2,2,31,67,
  111,110,116,114,111,108,108,101,114,0,
  3,3,83,12,8,22,0,2,26,129,
  0,9,32,13,7,0,16,84,72,69,
  0,129,0,4,39,25,8,0,136,83,
  104,101,105,107,104,0,1,0,-34,-111,
  12,12,1,2,31,88,0,1,4,79,
  44,12,12,0,37,151,240,159,147,162,
  0 }; 
   
// 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 
  uint8_t rgb_1_r; // =0..255 Red color value 
  uint8_t rgb_1_g; // =0..255 Green color value 
  uint8_t rgb_1_b; // =0..255 Blue color value 
  uint8_t switch_1; // =1 if switch ON and =0 if OFF 
  uint8_t select_1; // =0 if select position A, =1 if position B, =2 if position C, ... 
  uint8_t button_1; // =1 if button pressed, else =0 
  uint8_t button_2; // =1 if button pressed, else =0 

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

} RemoteXY; 
#pragma pack(pop) 

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

#define PIN_BUTTON_2 12

#define PIN_SWITCH_1 13

//define right motor control pins
#define right_motor_A 8
#define right_motor_B 9
#define right_motor_speed 11 //enable pin

//define left motor control pins
#define left_motor_A 6
#define left_motor_B 7
#define left_motor_speed 10 //enable pin

//define two arrays with a list of pins for each motor
uint8_t RightMotor[3] = {right_motor_A, right_motor_B, right_motor_speed};
uint8_t LeftMotor[3] = {left_motor_A, left_motor_B, left_motor_speed};

//speed control of motors
void Wheel (uint8_t * motor, int v) // v = motor speed, motor = pointer to an array of pins 
{
  if (v &gt; 100) v=100;
  if (v &lt; -100) v=-100;
  if (v &gt; 0){

    digitalWrite (motor [0], HIGH);
    digitalWrite (motor [1], LOW);
    analogWrite (motor [2], v * 2.55);
  }
  else if ( v&lt;0 ){

    digitalWrite (motor [0], LOW);
    digitalWrite (motor [1], HIGH);
    analogWrite (motor [2], (-v) * 2.55);
  }
  else{
    digitalWrite (motor [0], LOW);
    digitalWrite (motor [1], LOW);
    analogWrite (motor [2], 0);
  }
}


void setup() 
{
  RemoteXY_Init (); 
  
  pinMode (PIN_SWITCH_1, OUTPUT);
    pinMode (PIN_BUTTON_2, OUTPUT);
   
  
  //initialization pins
  pinMode (right_motor_A, OUTPUT);
  pinMode (right_motor_B, OUTPUT);
  pinMode (left_motor_A, OUTPUT);
  pinMode (left_motor_B, OUTPUT);
  
}

void loop() 
{ 
  RemoteXY_Handler ();
  
  digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
    
  digitalWrite(PIN_BUTTON_2, (RemoteXY.button_2==0)?LOW:HIGH);
   
  //manage the right motor
  Wheel (RightMotor, RemoteXY.joystick_1_y - RemoteXY.joystick_1_x);
  Wheel (LeftMotor, RemoteXY.joystick_1_y + RemoteXY.joystick_1_x);


}</code></pre></div><p>By Arduino IDE.</p><p>Please Please Please help me.</p><p>Any Help would be Appreciated.</p><p>Thanks in advance</p>]]></description>
			<author><![CDATA[null@example.com (naved.the.sheikh)]]></author>
			<pubDate>Sun, 29 Jul 2018 13:33:49 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=1716#p1716</guid>
		</item>
	</channel>
</rss>
