Android Bluetooth joystick

Hi Ruldi, thanks for this nice video 8)

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:

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:

  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 ;)

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

:-* :-* Sorry for that

Andro_four_PWM_D1.ino (8.41 KB)

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

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

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 :smiling_imp: :smiling_imp:

EDIT
Sketch updated to V1.1

AndroTest_ESP32_V1.1.ino (7.23 KB)

Hi Kas,

I am working with your app and sample code and ran into a snag last night. I am using the adafruit ez-link, nothing seemed to show up over the serial link. I believe the issue is the baud rate for ez-link is not selectable in the rc commander app so I am unsure of what baud it is actually connecting at. I will try with an hc-06 where the baud is set by the module. https://www.adafruit.com/product/1588

Is there a version of the app floating around that may have selectable baud?

Thanks!!

Is there a version of the app floating around that may have selectable baud?

Hi cshunt

No ::) ::)

There is no such thing as "baud rate" for Bluetooth radio transmission between two devices Baud rate only apply to the wired serial connection between BT card and Arduino

Try to adjust baud rate in AndroTest.ino demo sketch

BTW Bluefruit EZ-Link had major flaws and is now discontinued, just use a plain HC-05/HC-06 board

https://www.youtube.com/watch?v=ET9F-lOTPjQ&feature=youtu.be

Hi, Kas

I made this video so you can see the chair working perfectly

Kas is it possible to turn the bluetooth comander design a bit? When I put the 2 motors forward, I have to by the bluetooth comander diagonally

I would like to go up and go forward. and back the same thing

the diagonal control is confusing me a little lol

but if you can not do this well

Hi Ruldi,

Thanks for the video, you are now a super driver ;)

is it possible to turn the bluetooth commander design a bit? When I put the 2 motors forward, I have to by the bluetooth commander diagonally I would like to go up and go forward. but if you can not do this well

Let me see what I can do

Hi Rudi, This is version E, with differential steering

** Cuidado ** I still can't test the code, some joystick positions may produce unexpected moves Test carefully and let me have your comments

Hi, Kas

It really did look strange. the engines with this code behaved differently did not work nor the speed control and so connect the bluetooth comander the motors go out spinning and do not stop and when I put it forward they slow down

the image I posted shows the position of the joystick diagonally with the 2 front motors

the other image with the joystick up, the chair turns sideways

I do not know if I could explain it well, but that's it. Thank you for always being considerate.

[url=http://|500x281]|500x281[/url]

[url=http://|500x281]|500x281[/url]

Sorry for that I need to setup some equipment to really test the code

A bit busy for the moment, may take a while :( please go back to revision D for the moment

kas: Sorry for that I need to setup some equipment to really test the code

A bit busy for the moment, may take a while :( please go back to revision D for the moment

Okay Kas, I'll be waiting. meanwhile I'm going to redo all electrical installation and set some details God bless you

I think I got it ::slight_smile:

This is version E1 , please test it and let me know
Take great care

Andro_four_PWM_E1.ino (9.08 KB)

I know this is a really old thread, but is it still possible to get a copy of total RC commander? Thank you for your time. -Erik

Thanks for your interest Check your mail

End of technical support

I have been supporting this project for nearly four years, this was an exciting experience
I have since moved to other projects and it’s now time for me to retire

All possible questions have been answered in this thread, just read it :wink:
Feel free to use this thread on a peer to peer basis to share your experience
Please no more PM’s

Thanks again for your interest and good luck for your projects

One last contribution

Demo sketch for ESP32 V1.1

Enjoy ;)

Hi, thanks for sharing the Android app!

Is the source code of the Android app available?

Cheers, David

Im working with the arduino mega 2560 and its not working