Go Down

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

RULDI

#900
May 03, 2018, 05:20 pm Last Edit: May 03, 2018, 05:23 pm by RULDI Reason: add fotos
Kas  

see the prints I made
with code without deadMan, bt comander works fine, does not crash, and uses little cpu and mobile ram

already with the code deadMan, the cpu of the cell phone increases a lot, the ram also
j2 prime android 6.0


http://i68.tinypic.com/2zgbzt1.jpg[/img]]
http://i63.tinypic.com/2uiahdw.jpg[/img]]

RULDI

Please try again Andro_four_PWM_B.ino  and let me know

Also confirm that no devices (motor driver, ...) are attached to Arduino
Did it work before ?, did you change something in your Arduino setup ?
did you change something in your smartphonr setup ?
Give me more info, I need to reproduce this situation

EDIT: please confirm your phone brand, model and android version


não fiz nenhuma alteraçao,

testei o codigo com o driver
testei tambem  somente com arduino sem o driver

o problema é realmente o aumento de cpu e ram ,com o codigo deadMan
j2 prime android 6.0,  1,5G de ram

kas

Quote
não fiz nenhuma alteraçao,

testei o codigo com o driver
testei tambem  somente com arduino sem o driver

o problema é realmente o aumento de cpu e ram ,com o codigo deadMan
j2 prime android 6.0,  1,5G de ram
Il faut trouver un langage commun, je propose l'anglais  ;)


I am confused ...
This Arduino sketch has no sendBlueToothData() function and should not send anything back to the smartphone
The App has no idea whether the deadman function is implemented or not in the Arduino sketch

Let me think about it   :smiley-roll-blue:  :smiley-roll-blue:





kas

OK   :smiley-twist:  :smiley-twist:

You had to connect Arduino pin #0 to TX BlueTooth module to get commands from the App
I suspect you also connected Arduino pin #1 to RX BT module

Arduino pin #1 is used to send debug information to the Serial Monitor when DEBUG = true
In that case all this debug info is also transmitted via BlueTooth to the phone (hard to swallow)

Please make sure that nothing is connected to Arduino pin #1
Alternatively you can set DEBUG to false to stop debugging info transmission



RULDI


I CHANGE the baud, I lowered it to 9600, see the photo the cpu lowered to 25%

soon after I changed the baud to 4800 and the cpu dropped to 15%

will it be a congestion there?

with 9600 or 4800 baud, bt comander worked fine, did not crash

what do you think?



http://i66.tinypic.com/9lem4h.jpg[/img]]

http://i64.tinypic.com/2rh1zzb.jpg[/img]]

RULDI

OK   :smiley-twist:  :smiley-twist:

You had to connect Arduino pin #0 to TX BlueTooth module to get commands from the App
I suspect you also connected Arduino pin #1 to RX BT module

Arduino pin #1 is used to send debug information to the Serial Monitor when DEBUG = true
In that case all this debug info is also transmitted via BlueTooth to the phone (hard to swallow)

Please make sure that nothing is connected to Arduino pin #1
Alternatively you can set DEBUG to false to stop debugging info transmission



Okay, I'll disconnect pin 1
lol

RULDI

 : D
it worked out
Perfect
everything is OK
Soon I will post a video of the operation of the wheelchair

God bless you
you are awesome

kas

: D
it worked out
Perfect
everything is OK
Soon I will post a video of the operation of the wheelchair
8)  8)  8)
Make sure to be back @ 57600 baud and post the video when ready


RULDI

HI ,KAS

https://www.youtube.com/watch?v=C5dRRk6kT6o

I did a little video test
It worked very well the chair
just a problem, the speed was too fast to make maneuvers in the house
Is it possible to use the bt comander buttons to adjust the speed?
1 button with 30% speed
another with 60%
and another with 100% speed

THANKS

kas

#909
May 12, 2018, 06:31 am Last Edit: Jun 24, 2018, 04:15 pm by kas
Hi Ruldi, thanks for this nice video  8)


Quote
Is it possible to use the bt comander buttons to adjust the speed?
This is Andro_four_PWM_D.ino (rev D)
- Button management implemented
- High/Low speed using Button #1
- default mode is Low speed

Make sure to connect Arduino D1 to RX BT module,
DEBUG should now be set to 'false' at all time

Button #1 management code:
Code: [Select]
void getButtonState(int bStatus)  {
  switch (bStatus) {
// -----------------  BUTTON #1  -----------------------
    case 'A':
      buttonStatus |= B000001;        // ON
      fullSpeed = true;
      displayStatus = "Turbo";
      break;
    case 'B':
      buttonStatus &= B111110;        // OFF
      fullSpeed = false;
      displayStatus = "Low speed";
      break;


Within setMotorSpeed() function:
Code: [Select]
 if(fullSpeed == true) {
    pwm_1_a = map(joyX, 100, 200, 255, 0);                            //mapeamento para 0-100 pino A - 100-200 pino B
    pwm_1_b = map(joyX, 200, 300, 0, 255);
  
    pwm_2_a = map(joyY, 100, 200, 255, 0);                            //mapeamento da ponte 2
    pwm_2_b = map(joyY, 200, 300, 0, 255);
  }
  else {
    pwm_1_a = map(joyX, 100, 200, 127, 0);                            // Low speed
    pwm_1_b = map(joyX, 200, 300, 0, 127);
  
    pwm_2_a = map(joyY, 100, 200, 127, 0);                            // Low speed
    pwm_2_b = map(joyY, 200, 300, 0, 127);
  }


I suggest you access the App config menu and
- display two buttons only
- rename Button #1 to "Turbo"

Happy driving  ;)



RULDI

#910
May 12, 2018, 08:28 pm Last Edit: May 12, 2018, 08:32 pm by RULDI
HI KAS


when I press the turbo button it turns green and goes out quickly

speed does not increase
the communication seems perfect to me

I do not know why speed does not increase.

http://pt-br.tinypic.com/r/2u47u2t/9

http://pt-br.tinypic.com/r/292o2kp/9

kas

 :-*  :-*   Sorry for that


RULDI


Hi, Kas
I am very happy with bt comander and the code that you have developed
I will finish the electric installation in the wheelchair, soon I will post another video with the operation
thank you so much

kas

Hi Ruldi
Thanks for the feedback   8)
Let us have the video when ready


kas

#914
May 22, 2018, 11:42 am Last Edit: Jul 28, 2018, 02:02 pm by kas
Good new, classic Bluetooth feature is now available for ESP32
Get the Arduino IDE library here


I have ported the basic Arduino demo sketch (AndroTest_V20_POSTED.ino) to this super platform
No wiring, no software setup, nothing !!
just upload to ESP32 and enjoy

All in one small board for 5 bucks shipped    that's insane   :smiley-twist:  :smiley-twist:



EDIT
Sketch updated to V1.1

Go Up