GithubHelp home page GithubHelp logo

williamdemirci / arduino-4wd-mecanum-controlled-by-android-app Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 8.77 MB

Arduino 4WD Mecanum controlled by Android app

License: MIT License

C++ 29.93% C 6.77% Java 63.30%
arduino android mecanum-wheel bluetooth l293d hc-05 arduino-mega 4wd apk

arduino-4wd-mecanum-controlled-by-android-app's Introduction

Arduino 4WD Mecanum controlled by Android app

Arduino 4WD Mecanum controlled by an Android app using an Arduino Mega 2560, a L293D motor shield and a HC-05 Bluetooth Module.

Application

The APK of the application can be downloaded here APK.
Get it on Google Play

How to use the application?

  1. Switch on the Arduino and the HC-05 Bluetooth module.

  2. On your smartphone, scan the available Bluetooth devices and associate with the HC-05 Bluetooth module with the default password "1234".

  1. Install and start the application. Link of the APK

  2. Select the HC-05 Bluetooth module.

  1. Have fun!

The application contains:

  • A joystrick and two buttons to control the robot
  • A seekbar to control speed
  • A switch in the top left to switch to night mode
  • A button to disconnect from the robot

Arduino

Bluetooth wiring

Don't forget to cross RX and TX!

Motor shield wiring (L293D)

How is the robot controlled?

Frame format

The frames are in the following form: sxxyyy
- "s" for "start" allows us to know when a frame starts
- "xx" is the value of the movement performed by the user. For example, if the joystick is pushed forward to go straight, the movement will be "03".
- "yyy" is the value of the speed chosen by the user. For example, if the speed is at maximum, the value will be "255".

For this example, the final result is as follows: s03255

To summarize: 1 header letter + two movement digits + three speed digits

How to use the application on another robot?

  1. Retrieve the data received by Bluetooth and separate them if necessary


    receivedData = Serial1.readStringUntil('s'); // split received data into frames delimited by a 's'
    move = receivedData.substring(0,2).toInt(); // split two first digits to get movement value
    speed = receivedData.substring(2,5).toInt(); // split three last digits to get speed value

  2. Perform the processing according to the data received.


    For example:
    moveRobot(move, speed);

Author

WilliamDemirci

License

MIT License. See the LICENSE file for details.

Other

Feel free to contact me if I can optimize the code or if there is an errorr. I'm a newbie. Thank you!

arduino-4wd-mecanum-controlled-by-android-app's People

Contributors

williamdemirdjian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.