Go Down

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

kas

Hi Kas
A thought for the future.
Would it be possible to have the Android device get Button Labels and Datafield Labels from the Arduino IDE via the BlueTooth comms.
e.g  B1 = "LED <On/Off>"
     Data3 = "Status"
Interesting idea

I also have in mind to create a config file within the App
to store specific Button and Datafield Labels for several bots



Enerik

#871
Dec 23, 2017, 11:10 pm Last Edit: Dec 24, 2017, 05:35 pm by Enerik
Hello Kas ,


I am having a bit of trouble using the demo sketch on the atmega328P.
I am trying to do a BT controled arduino robot using two servos and the L9110 IC to control them as normal dc motors .
The problem is that the motor control works ok but i cant get any data transmited from the robot to android app , for example battery .
Also i am trying to set up an auto mode using a HC-sr04 sensor to measure distance but until now i cant figure out how to do it so ican activate it and deactivate it from a button on android app .
Attached is my code based on the demo code v2 , the app version is 5.5.



Cheers
Enerik

kas

Quote
The problem is that the motor control works ok but i cant get any data transmitted from the robot to android app , for example battery
Probably a wiring problem

Please forget your current project and go back to the basics
 - genuine Arduino Uno
 - original AndroTest V2.0 plain sketch
 
Let me know if it works



christophe_schmol

Hello Kas,

I am using your android application together with L298 driver module and hc05 Bluetooth module to control the tyco rebound RC car.

So far I am very happy about the app and it is very useful to me, thank you.

I have a few inquiries about the android app:

1. The RC car has 4 wheels, 2 left wheels are on one motor, 2 right wheels on the other motor.
Is it possible to modify the android application to have 2 controls (instead of one 2D-joystick), one for each motor?

2. I get a lot of 200 200 packets that do not correspond to joystick in (0,0) position and I have to filter these packets out in the android part, is this a known bug or am I doing something wrong? Because of this I can currently not use the "return-to-zero"-feature.

3. I would also like to have the possibility to engage active breaking (when thumb in 0 position) and free running motor (return to zero activated and no thumb on touch screen). Is it possible to send different flags also?

4. I have not found the source code anywhere, is it correct to assume that the code will not be released?

It would be nice if I you could answer some of my questions :)


kas

Quote
I am using your android application together with L298 driver module and hc05 Bluetooth module to control the tyco rebound RC car.
So far I am very happy about the app and it is very useful to me, thank you.
Thanks for the kind words   ;)

Sorry, this is a free robust multipurpose k.i.s.s App, I won't add additional features
The code is not public, as it is the base of a paid App



Quote
I get a lot of 200 200 packets that do not correspond to joystick in (0,0) position and I have to filter these packets out in the android part, is this a known bug or am I doing something wrong? Because of this I can currently not use the "return-to-zero"-feature.
Joystick BT has no known bugs AFAIK
Please let me have additional info, you may use the debug code
also make sure your communication is set at 57600 bps




christophe_schmol

Hello Kas,


Sorry, this is a free robust multipurpose k.i.s.s App, I won't add additional features
Ok that makes sense, I guess I will have to write an app myself, if I find the time for it :/



The code is not public, as it is the base of a paid App
What additional features does the paid app provide?
I have not found the app in the play store so far.


Joystick BT has no known bugs AFAIK
Please let me have additional info, you may use the debug code
also make sure your communication is set at 57600 bps
I use the hc05 bluetooth module and set the baud rate to 57600 via AT commands, then I connect the android application to the module and hook up my salea logic analyzer.
There I find out that indeed some "erronous" packets (with contents 200200) are sent over the bluetooth link.

App configuration:
- return to center: off
- two buttons displayed (not used)
- 3 data fields (not used)
- refresh interval: 25 milli
- timeout count: every 100 intervals
- no baud rate setting in the app (why?)

Here are the screenshots:
Overview of the saved transmissions:


Correct transmission:


Incorrect transmission:


This is the output from the logic analyzer async serial decoder.
Code: [Select]
Time [s],Value,Parity Error,Framing Error
0.000351500000000,'2' (0x02),,
0.000525125000000,2 (0x32),,
0.000698750000000,7 (0x37),,
0.000872375000000,1 (0x31),,
0.001046000000000,2 (0x32),,
0.001219625000000,8 (0x38),,
0.001393250000000,8 (0x38),,
0.001566875000000,'3' (0x03),,
0.026932958333333,'2' (0x02),,
0.027106583333333,2 (0x32),,
0.027280166666667,6 (0x36),,
0.027453833333333,7 (0x37),,
0.027627458333333,2 (0x32),,
0.027801083333333,9 (0x39),,
0.027974666666667,1 (0x31),,
0.028148291666667,'3' (0x03),,
0.050441291666667,'2' (0x02),,
0.050614916666667,2 (0x32),,
0.050788500000000,6 (0x36),,
0.050962166666667,6 (0x36),,
0.051135791666667,2 (0x32),,
0.051309375000000,9 (0x39),,
0.051483000000000,3 (0x33),,
0.051656625000000,'3' (0x03),,
0.076988000000000,'2' (0x02),,
0.077161625000000,2 (0x32),,
0.077335250000000,6 (0x36),,
0.077508875000000,4 (0x34),,
0.077682500000000,2 (0x32),,
0.077856125000000,9 (0x39),,
0.078029708333333,4 (0x34),,
0.078203333333333,'3' (0x03),,
0.100392166666667,'2' (0x02),,
0.100565750000000,2 (0x32),,
0.100739375000000,6 (0x36),,
0.100913000000000,0 (0x30),,
0.101086625000000,2 (0x32),,
0.101260250000000,9 (0x39),,
0.101433875000000,6 (0x36),,
0.101607500000000,'3' (0x03),,
0.125688791666667,'2' (0x02),,
0.125862416666667,2 (0x32),,
0.126036041666667,5 (0x35),,
0.126209666666667,9 (0x39),,
0.126383291666667,2 (0x32),,
0.126556916666667,9 (0x39),,
0.126730541666667,6 (0x36),,
0.126904125000000,'3' (0x03),,
0.150707583333333,'2' (0x02),,
0.150881208333333,2 (0x32),,
0.151054833333333,5 (0x35),,
0.151228458333333,8 (0x38),,
0.151402083333333,2 (0x32),,
0.151575708333333,9 (0x39),,
0.151749333333333,7 (0x37),,
0.151922958333333,'3' (0x03),,
0.179407208333333,'2' (0x02),,
0.179580833333333,2 (0x32),,
0.179754458333333,5 (0x35),,
0.179928083333333,7 (0x37),,
0.180101708333333,2 (0x32),,
0.180275333333333,9 (0x39),,
0.180448958333333,7 (0x37),,
0.180622583333333,'3' (0x03),,
0.180796208333333,'2' (0x02),,
0.180969833333333,2 (0x32),,
0.181143458333333,0 (0x30),,
0.181317083333333,0 (0x30),,
0.181490625000000,2 (0x32),,
0.181664291666667,0 (0x30),,
0.181837875000000,0 (0x30),,
0.182011500000000,'3' (0x03),,
0.182185125000000,'2' (0x02),,
0.182358750000000,2 (0x32),,
0.182532375000000,4 (0x34),,
0.182706000000000,3 (0x33),,
0.182879625000000,2 (0x32),,
0.183053250000000,6 (0x36),,
0.183226875000000,0 (0x30),,
0.183400500000000,'3' (0x03),,
0.204183000000000,'2' (0x02),,
0.204356625000000,2 (0x32),,
0.204530250000000,5 (0x35),,
0.204703875000000,5 (0x35),,
0.204877500000000,2 (0x32),,
0.205051041666667,9 (0x39),,
0.205224666666667,6 (0x36),,
0.205398291666667,'3' (0x03),,
0.227969125000000,'2' (0x02),,
0.228142750000000,2 (0x32),,
0.228316375000000,5 (0x35),,
0.228490000000000,4 (0x34),,
0.228663625000000,2 (0x32),,
0.228837166666667,9 (0x39),,
0.229010791666667,5 (0x35),,
0.229184416666667,'3' (0x03),,
0.252970541666667,'2' (0x02),,
0.253144166666667,2 (0x32),,
0.253317791666667,5 (0x35),,
0.253491416666667,1 (0x31),,
0.253665041666667,2 (0x32),,
0.253838666666667,9 (0x39),,
0.254012291666667,4 (0x34),,
0.254185916666667,'3' (0x03),,
0.276982375000000,'2' (0x02),,
0.277156000000000,2 (0x32),,
0.277329625000000,5 (0x35),,
0.277503250000000,0 (0x30),,
0.277676875000000,2 (0x32),,
0.277850500000000,9 (0x39),,
0.278024125000000,3 (0x33),,
0.278197750000000,'3' (0x03),,
0.328374291666667,'2' (0x02),,
0.328547916666667,2 (0x32),,
0.328721541666667,5 (0x35),,
0.328895166666667,0 (0x30),,
0.329068791666667,2 (0x32),,
0.329242416666667,9 (0x39),,
0.329416041666667,2 (0x32),,
0.329589666666667,'3' (0x03),,
0.378325208333333,'2' (0x02),,
0.378498833333333,2 (0x32),,
0.378672458333333,5 (0x35),,
0.378846083333333,1 (0x31),,
0.379019708333333,2 (0x32),,
0.379193250000000,9 (0x39),,
0.379366875000000,1 (0x31),,
0.379540500000000,'3' (0x03),,
0.404316291666667,'2' (0x02),,
0.404489916666667,2 (0x32),,
0.404663541666667,5 (0x35),,
0.404837166666667,2 (0x32),,
0.405010791666667,2 (0x32),,
0.405184416666667,9 (0x39),,
0.405358041666667,1 (0x31),,
0.405531666666667,'3' (0x03),,
0.429248333333333,'2' (0x02),,
0.429421958333333,2 (0x32),,
0.429595583333333,5 (0x35),,
0.429769208333333,5 (0x35),,
0.429942833333333,2 (0x32),,
0.430116458333333,8 (0x38),,
0.430290083333333,9 (0x39),,
0.430463708333333,'3' (0x03),,
0.456732583333333,'2' (0x02),,
0.456906208333333,2 (0x32),,
0.457079833333333,5 (0x35),,
0.457253458333333,7 (0x37),,
0.457427083333333,2 (0x32),,
0.457600708333333,8 (0x38),,
0.457774333333333,8 (0x38),,
0.457947958333333,'3' (0x03),,
0.480553416666667,'2' (0x02),,
0.480727041666667,2 (0x32),,
0.480900666666667,5 (0x35),,
0.481074291666667,9 (0x39),,
0.481247916666667,2 (0x32),,
0.481421541666667,8 (0x38),,
0.481595166666667,7 (0x37),,
0.481768791666667,'3' (0x03),,


https://ibb.co/cpNuCG
https://ibb.co/bJjkKw
https://ibb.co/fRBAmb


I hope I can help you in finding the issue with this information.
Please tell me when you need further data, I will be happy to provide.


kas

#876
Jan 04, 2018, 08:26 am Last Edit: Jan 04, 2018, 08:27 am by kas
Quote
What additional features does the paid app provide?
I have not found the app in the play store so far.
Have a look at Total  RC Commander


Quote
no baud rate setting in the app (why?)
The Bluetooth wireless transmission is by no way related to the HC-xx board Serial output


Quote
refresh interval: 25 milli
Which smartphone are you using ??
Please try 50 ms refresh interval and let me know if it helps



Go Up