Go Down

Topic: Android Bluetooth joystick (Read 382044 times) previous topic - next topic

kas

Quote
Hey kas,

I have a question , do you know why my rover moves slower using arduino than when I use a RC rx ? Its like it's only going to 85% of its power.
::)  ::) 

Make sure LIMIT_ANGLE is zero


Try changing
void motorsControl()  {
  myservoX.write(servo_L);
  myservoY.write(servo_R);
}

to

void motorsControl()  {
  myservoX.write(servo_L * 1.2);
  myservoY.write(servo_R  * 1.2);
}

and let us know the outcome




kas

#826
Nov 27, 2016, 11:25 am Last Edit: Nov 27, 2016, 11:27 am by kas
Quote
can you sned me the code for the apk instead?
Joystick BT Commander is the base of Total BT Commander (paid App)
Sorry, source code is not available




geeameal

Easy to do... let's see...
Android programming is a fascinating universe
Three very different approches are available on the market, with increasing learning curves
App Inventor
A full graphic cloud based application, just fitting together puzzle pieces
still in development, very intuitive but a bit limited for the moment

Basic4android 
using a syntax MS Visual Basic syntax, creates native Android applications

Eclipse + Android SDK
for full blown applications, a bit frustrating at startup  :smiley-eek: :smiley-eek: :smiley-eek:
A first experience with Java will definitly help
Tons of help and snippets, at XDA developpers
lots of tuto's on Youtube

I tried App Inventor and finally choosed the hard way... 8)
Thanks for this excellent feedback :)

Out of curiosity, where is the Land of sun+snow ??
can this app be done using app inventor? :) thanks kas

kas

Quote
can this app be done using app inventor? :) thanks kas
Please refer to post #817
I never really used this IDE, it may/should work


fullspool

::)  ::) 

Make sure LIMIT_ANGLE is zero


Try changing
void motorsControl()  {
  myservoX.write(servo_L);
  myservoY.write(servo_R);
}

to

void motorsControl()  {
  myservoX.write(servo_L * 1.2);
  myservoY.write(servo_R  * 1.2);
}

and let us know the outcome




Hey Kas,

I've tried this and the motors start to move as soon as power is applied with zero stick movement.

kas

#830
Dec 01, 2016, 07:41 am Last Edit: Dec 01, 2016, 07:43 am by kas
Quote
I've tried this and the motors start to move as soon as power is applied with zero stick movement
Oops sorry    :-[


In getJoystickState(), please replace

  if(joyY >-10)  {                                                    // differential steering
    servo_L = (joyY - (3*joyX)/4);
    servo_R = (joyY + (3*joyX)/4);
  }  else  {
    servo_L = (joyY + (3*joyX)/4);
    servo_R = (joyY - (3*joyX)/4);
  }

by

  if(joyY >-10)  {                                                    // differential steering
    servo_L = (joyY - (3*joyX)/4) * 1.2;
    servo_R = (joyY + (3*joyX)/4) * 1.2;
  }  else  {
    servo_L = (joyY + (3*joyX)/4) * 1.2;
    servo_R = (joyY - (3*joyX)/4) * 1.2;
  }



fullspool

#831
Dec 02, 2016, 04:17 am Last Edit: Dec 02, 2016, 02:09 pm by fullspool
kas , I think that fixed it! it is so much more responsive thank you!

what do you think about the low voltage alarm and amp stall warning?

I will make a new video showing the rover you help me so much create.

kas

#832
Dec 02, 2016, 10:23 pm Last Edit: Dec 02, 2016, 10:29 pm by kas
Quote
kas , I think that fixed it! it is so much more responsive thank you!
You may adjust the "1.2" value for optimal results


Quote
Kas is there a way to peogram a dead mans cut if it sees over 100 amps and if it gets below 20 volts it will sound off a buzzer?
As you suggest, high Amp value probably means stalled motors
Power should be shut off until Arduino is reset

Low voltage is only an early warning, with no immediat actions required


Assuming your current Amp reading is correct, modify your checkAmp function:

Code: [Select]

void checkAmp()   {
 milliAmp = 244.14062 * analogRead(Apin) - 125000.0;
 if(milliAmp > 50000)    {                                                // 50 Amps
   myservoX.write(90);                                                    // stop motors
   myservoY.write(90);
   while(1);                                                              // loops for ever            
 }
}

To avoid overflow at 65 Amps, change  int milliAmp  to  long milliAmp


For low battery, do you have a built in buzzer ??





salviador

Are there a example for arduino 101?

kas

Hi Michele,

Sorry, no experience with this new beast   ::)
Hope someone will jump in with additional info



rossi86m

Edit:    **  Current Versions  **

         - Joystick bluetooth Commander:    V5.2
         - AndroTest.ino demo sketch:            V2.0


* New *   
Code for Parallax Propeller, in "C"
  (thanks twm47099)
Code for Parallax Propeller in "Spin"
  (thanks jonnyMac)


        - Samsumg Galaxy Tab 4 users,
please look here

scroll to the end of this message to get latest information


Hi,
I developed an Android application that turns a smartphone into a virtual Bluetooth joystick.
The applications in the robotic field are endless: Home Automation, R/C cars, robotic arms and of course  balancing robots ;)



By default, the device transmits data every 200ms
Data format: [STX  X  Y  ETX]   
example: [0X02  0X2A  0X30  0X03]

The application is available (for free 8)) here
From you smartphone, access Google Store and search for "Joystick bluetooth Commander"

This demo Arduino sketch will parse data on the serial monitor, and control the pin13 LED
Code: [Select]
// AndroLED V5
// Arduino test sketch for Joystick BT commander
// LED control for buttons + joystick echo to serial monitor

//    ** deprecated, please use AndroTest_V13.ino **
//    see reply #181


http://www.youtube.com/watch?v=jNiGa_gK2KU

The Hardware setup is rather straightforward, should you need additional info, just let me know

Enjoy

Edit:
Updated Arduino sketch,
set Baud rate to default 9600
removed softserial
For sketch upload, don't forget to disconnect board TX from Arduino D0

Edit2:
Joystick Bluetooth Commander Version 2.3 is now compatible with Android V3.X and V4.X (Honeycomb, Ice Cream Sandwich, Jelly Bean)

Edit3:
added   Serial.println("Bluetooth Commander simulation") in setup() for communication testing purpose

Edit4:
Joystick Bluetooth Commander Version 2.4

Four toggle buttons with visual feedback

Change Log and Arduino sketch modification: please refer to reply #51

Edit5:
Joystick Bluetooth Commander Version 2.5


Change Log: refer to reply #70

Edit6:
Joystick Bluetooth Commander Version 3.0

** major Upgrade **
Joystick Bluetooth Commander is now a full blown two way Bluetooth communication application
Arduino sends back a button status Byte and a user defined data Byte to be displayed on the phone/tablet screen (Bot battery level is a nice candidate)

Communication protocol has changed
Joystick data is now transmitted as an integer = 2 Bytes (Most Significant Byte + Less Significant Byte)
<STX  MSB-X  LSB-X  MSB-Y  LSB-Y  ETX>
Your V2.5 Arduino sketch needs to be modified for V3.0


See full change Log at reply #74
Updated demo Arduino sketch at reply #90

Edit7:
Fixed link to Balancing robot for dummies

Edit8:
New Arduino demo sketch (V10.1)
Improve decoding algorithm, see reply #98

Edit9:
Joystick Bluetooth Commander Version 3.1
Maintenance release, see reply #100

Edit10:
New Arduino demo sketch (V10.3)                << for Artouste   ;)
Bug fix, see reply #129

Edit11:
Joystick BT Plus  has been released with 6 buttons and 4 data bytes



The actual number of buttons and data fields is adjustable within the Option menu
Fields and buttons labels are fully customizable
See reply #165

Edit11:
Detailed info re Communication Protocol (send and receive)
See reply #154 & #156

Edit12:
Joystick BT Plus (6 buttons, 3 datafields)
and
Total RC Commander (video from IP camera)
are now available see reply #177


More info here


Edit13:
Joystick BT Plus (up to 6 buttons, up to 3 free format datafields) is now
                - Joystick bluetooth Commander V4.0 -
and is available on Google Play as a free upgrade.

To allow text datafield, Communication Protocol has changed
Please use and adapt AndroTest_V13.ino demo sketch to your own needs   
** deprecated, please use AndroTest_V14.ino **
See reply #181


Edit14:
Communication Protocol for Joystick bluetooth Commander V4.x and Total RC Commander
now fully documented
See reply #188


Edit15:
A video showing tank control using Total RC Commander. has been posted in the Exhibition Section
More info here




Edit16:
AndroTest_V14.ino
This updated sketch features optimized timing and better transmission error management
Make sure your BT board is set @57600bps
See reply #210

Edit17:
AndroTest_V141.ino
See reply #212

Edit18:
BT boards types and configuration tools
See reply #227

Edit19:
Joystick bluetooth Commander Version 5.0 has just been published on Google Play

** Communication protocol has changed **    see reply #252
- Change log:   see reply #259
- Demo sketch: AndroTest V2.0      see reply #256

Edit20:
Joystick bluetooth Commander Version 5.2 now on Google Play
- Change log:   see reply #292
- Demo sketch: AndroTest V2.0      see reply #256

Edit21:
For my new project, I am testing a robotic claw using Joystick BT Commander




I am developing a similar app to control an arduino quadcopter. I would like to know which is the joystick libriary? and if it is opensourse?

Thanks in advance,
Marco

kas

Hi Marco,
google for   joystick "mobile anarchy"

Nexus99

#837
Mar 01, 2017, 11:35 pm Last Edit: Mar 03, 2017, 09:22 pm by Nexus99
Just wanted to send you a note thanking you for writing "Total RC Commander".

My Son and I have developed a few different differential drive bots (one with continually rotating servo's and a larger bot with a dual DC motor controller).
We have converted them both to work with your software. We are very happy with the analog joystick, buttons, data feedback, and of course the video option.

Thought you might also be interested to know that Total RC commander also works with an old android 4.0.3 cell phone running a free app called "IP Webcam" (http://192.68.1.1:8080/videofeed).
It provided us a small (basically free) camera solution for our bots.

Thanks again from both me and my son

Isaac96

That bot looks great. Do you have a link to the app?
Incidentally, the IP address to your stream doesnt work because the port isn't forwarded. :)
Do not PM me for help. I will delete immediately.
CONNECT THE GROUNDS!

After Tuesday, even the calendar goes W T F

kas

#839
Mar 03, 2017, 07:41 am Last Edit: Aug 22, 2018, 06:47 pm by kas
Wahoo... very strange beasts   :smiley-eek-blue:



Kudos for this very original work


Quote
Thought you might also be interested to know that Total RC commander also works with an old android 4.0.3 cell phone running a free app called "IP Webcam" (http://192.68.1.1:8080/videofeed).
Using an old smartphone as an IP camera is a great way to grant them a "second life"
If you happpen to produce some video's, just upload them to YouTube and drop a link here.

Thanks for your excellent feedback



@Isaac96
Quote
Do you have a link to the app?
Just have a look at 1st post in this thread



Go Up