Go Down

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

billcat

hi kas...again,

Sorry but I just now noticed your recent proposed "total rc commander", which looks  :D :D.  I had just been thinking it would be great if there were a few more buttons, and a way to send more data info. 

Do you know if this version would work with my galaxy s3 and if so, is it also available on the google store?

kas

#136
Jan 17, 2014, 08:51 am Last Edit: Jan 17, 2014, 09:03 am by kas Reason: 1
Quote
Works perfect!  Thanks for the fix, I am now able to do what I want with the leds I mentioned

@billcat
Glad it now works  :) :) :)

@all
AndroLEDV10.2 introduced a nasty bug: buttonStatus was both declared as global and local
buttonStatus (global) was therefore never updated  :smiley-red:
Please  discard V10.2 and download V10.3 (see reply #129)

Quote
Now I need to address the r/c servo scenario. I will try to figure it out myself first, but will probably end up needing advice on that later
Joystick Bluetooth Commander was specificaly developped for driving up to two r/c servo's. should you have any problem with the code, please ask  ;)


Quote

I just now noticed your recent proposed "total rc commander", which looks   :D :D :D.  I had just been thinking it would be great if there were a few more buttons, and a way to send more data info.  
Do you know if this version would work with my galaxy s3 and if so, is it also available on the google store?
Total RC Commander (with video stream display) is in development with tolisn63 support, now nearly ready
I invested quite a lot of time (and some money) in this project  :smiley-roll:
My plan is to propose this application on Google Store for a couple of bucks, but I am concerned by Google privacy policy...

@all
Should you be interested by this App, please contact me via PM

juycce

This is looking better and better Kas, i belive you should go for the app,i am shore more than one would want a app like this,that can control a rc car toy with video ...with your phone.I am going to trie it soon,for the moment i am wayting the bluetooth JY MCU HC6 (hope its compatible)..
My ideea is to fit the Arduino and the JY-MCU with one servo for steering,one TB6612FNG motor driver,and cuple Leds,and a buzzer
If all this will work properly i will try out the camera funcion,so one again,im telling you,this app will have succes,you should look at how many visit this post had.Nice job..Thank you ;)

kas

#138
Jan 21, 2014, 07:31 am Last Edit: Jan 21, 2014, 07:33 am by kas Reason: 1
Quote
This is looking better and better Kas, i belive you should go for the app,...
...,so one again,im telling you,this app will have succes,you should look at how many visit this post had.Nice job..Thank you  ;)

Thanks juycce for the kind word  8)
The App is ready, but rather demanding in term of processing power (bluetooth + wifi)
Together with tolisn63 we are busy optimising the code

@all
Any candidate as a second beta tester ??
required:
- high end tablet (google, Samsung...)
- a different IP camera (not Wanscam)

juycce

i just recived my JY-MCU V1.06 but i can't figure out how to pair it with the phone...I load the sketch (with the TX,RX pin disconected) search it with the phone pair it (1234) then open the app and it say Unable to connect device" , and Led wont get solid
I guess it is not compatible with the V1.06 :( ....any ideeas

..i tried all the codes you post..even that one that only control 2 servo ...thx

kas

#140
Jan 24, 2014, 06:30 pm Last Edit: Jan 27, 2014, 09:45 pm by kas Reason: 1
No needs to load any sketch, this is a pure RF affair between Bluetooth module and Android device  ;)
Arduino board is not involved at this stage

1- Just make sure to connect 3V + Ground to BT board
2- BT board led should blink red
3- Pair the Android device with BT board, if not already done
4- Open BT Joystick Commander
5- Make sure "Option for advanced users/Auto connect" is unchecked
6- (exit/relaunch the application if any change)
7- Press "connect", make sure you see your BT device in the paired section
8- Select your BT device
9- BT device led should change from blinking to solid red
10- Android BT Commander should report: "connected to XXXXXX"

Let me know the outcome

juycce

Hello Kas,these days i've been diggin more about bluetooth arduino comunicancion and this is what i found:
JY-MCU HC 06 is compatible with android comunicacion (running ArduDroid app,it works flawlesly,i can control all pins on board Digital,PWM,and Analog) with my phone(HTC Wildfire S).But refuse to pair your app...so i tried to run it from another phone (Samsung S3) and yes it pairs just like u said...so i belive the BT Joystick app is not compatible with Android 2.3.5 :(( ....even so...if i had BT connection i couldn't get any movement ,joystick or Leds...i tried default config and changing parameters with no result
Could you post the first versions of the Bluetooth Joystick Aplicacion so i can trie it out? thank you for you help

kas

#142
Jan 27, 2014, 09:47 pm Last Edit: Jan 27, 2014, 10:06 pm by kas Reason: 1
Quote
But refuse to pair your app..

Not sure I understand
Pairing is an operation between your phone and the BT card
Apps are not involved in this process
Do you mean "connect" ??
Please clarify
Also let me know at which step (1 to 10) you are getting in trouble

Quote
so i belive the BT Joystick app is not compatible with Android 2.3.5

The app is compatible with Android V2.2 (API level 8 ) and higher

Quote
even so...if i had BT connection i couldn't get any movement ,joystick or Leds.

So you got connected ??
Please clarify

Quote
Could you post the first versions of the Bluetooth Joystick Aplicacion so i can trie it out?

Sure, let me have your email via PM

kas

Quote
I had just been thinking it would be great if there were a few more buttons, and a way to send more data info.  
Do you know if this version would work with my galaxy s3 and if so, is it also available on the google store?


hi Billcat
Check your mail
Six buttons + 4 data bytes  ;)

This is how it looks on my Sony Xperia Mini (3" 320X480)


Please let me have a screen shot from your Samsung galaxy S3 (4.8" 1280X720)


billcat


Please let me have a screen shot from your Samsung galaxy S3 (4.8" 1280X720)



Hello kas,

sorry for the delay....,

here is the screenshot from Samsung Galaxy S3.  It looks great!  But I have not had a chance to test it with/or the Arduino sketch, hopefully soon and I can let you know the outcome :D

thanks again!

kas

@Billcat,
Based on your feedback, I will slightly move the joystick on the right, for the next release
I will appreciate you test the app when you have time (no rush ;))

@nemesis159
I will answer you questions later today

kas

#146
Feb 12, 2014, 06:07 pm Last Edit: Feb 12, 2014, 06:10 pm by kas Reason: 1
Quote
hi, bro estoy tratando de usar tu app de android, es la mejor que e visto, con la parte de los botones no tengo problemas pero no entiendo como usar la el joystick para controlar motores dc con un puente H, si me pudieras dar una orientacion seria exelente, es lo que me falta para terminar el proyecto, te dejo el link del puente h que yo uso.
http://www.pololu.com/product/713



Hi nemesis159

For general matters such as DC motor control, Google is your best friend  ;)
This is a quick basic example for one motor, using joyY (joystick vertical moves)
Pin configuration is based on 328P chip



Code: [Select]

*** AndroLED V10.3 modification: ***

/* add this code in the define section */
#define AIN1  4   // connect AIN1 to Arduino pin 4 ...
#define AIN2  5
#define PWMA  6
#define STBY  7


/* add this code in the setup function */
pinMode(AIN1,OUTPUT);
pinMode(AIN2,OUTPUT);
pinMode(PWMA,OUTPUT);
pinMode(STBY,OUTPUT);
digitalWrite(STBY, HIGH);


/* replace getJoystickState() with this one */
void getJoystickState(byte data[5])    {
 int joyX = (data[1]<<7) + data[2];
 int joyY = (data[3]<<7) + data[4];
 joyX = joyX - 200;               // Offset to avoid
 joyY = joyY - 200;               // transmitting negative numbers
 
 joyY = map(joyY, -100, +100, -255, 255);
 joyX = map(joyX, -100, +100, -255, 255);

 if(!DEBUG)  {
   Serial.print("Joystick data:  ");
   Serial.print(joyX);  
   Serial.print(", ");  
   Serial.println(joyY);
 }

 if(joyY > 0) {
   digitalWrite (AIN1,HIGH);
   digitalWrite (AIN2,LOW);
 }  else if(joyY < 0)  {
   digitalWrite (AIN1,LOW);
   digitalWrite (AIN2,HIGH);
 }  else  {
   digitalWrite (AIN1,LOW);
   digitalWrite (AIN2,LOW);

 analogWrite(PWMA,joyY);
}


Option/Data Range should be set to -100 +100

Please note that DC motors do not work well with low PWM values
Should you have motors with built in rotary encoders, consider adding PID control
Full discussion here

Let us know how it works (can't test it now)

powermik

Hi!

Just (re-)discovered your software and this thread. Is there a possibility for a second joystick?

Michael

kas

I am finalising the video embeded application



and need another beta tester with a different IP camera brand (Foscam or others), not Wanscam
Please contact me via PM

billcat

#149
Feb 27, 2014, 03:33 pm Last Edit: Feb 27, 2014, 03:38 pm by billcat Reason: 1

@Billcat,
Based on your feedback, I will slightly move the joystick on the right, for the next release
I will appreciate you test the app when you have time (no rush ;))

Hello Kas,

I have made a little time to play....  using Samsung Galaxy S3,
I have partially tested Joy BT Plus with AndroLedVidV11.   Only the buttons, to control some leds.  For the most, all seems to be working well :D

I think the joystick may still be moved slightly more to the right yet....no complaints here :smiley-red:....but since you mentioned it already.

But I remain very confused by how most of the sketch works, so I simply made all 'case' statements similar, and commenting out what I think does the momentary and debug parts here.  At the same time, changing the main debug to true, all joystick motions and button pushes reveal some change in information displayed in serial monitor.

I also think there may be a slight problem when choosing to view the data  as bytes sent....see screenshot.  Seems to be missing the closing ")"  and possibly some data. Perhaps I am mistaken, I still remain very unclear on how 1's and 0's are sent and received!
All of the menus display well with proper grammar, far as I can tell.  Another thing, I cannot seem to get anything out of the haptic feedback options, but it may be some other setting  on the phone.  But, I am able to get the phone to vibrate on ring, if that means anything.

Also, I do have some interest regarding the Beta testing for video.  I do not own an IP camera, but that is a simple fix $) .   Seems a bit out of my league yet, but would be a challenge that should help increase my knowledge base.   Feel free to contact me via PM/email.

Cheers,
Bill

Go Up