Git Product home page Git Product logo

esp32-robot-controller's Introduction

ESP32-Robot-Controller

Repo for the library to run an FRC-style robot from an ESP32 microcontroller with a Bluetooth joystick and PWM control for motors.

General Information

Currently the only supported joystick is a PS3 Controller, although support for PS4 controllers may be a possibility in the future. The motor controller class uses the PWM timers and channels built into the ESP32, and you can control which the resolution, frequency, pin #, and channel used for the PWM. The values allowed to be passed to the set() method are limited by what resolution is specified, with the default being 8 bits, and the maximum being 16 bits. In other words, if in 8 bit mode, the maximum power value that can be specified is 127, and the minimum is -128, whereas in 16 bit mode, the maximum is 32767 and the minimum is -32768. 8 bit mode is the default since that is also the resolution of the joysticks on the PS3 controller, so it makes the translation extremely simple.

Installation and Setup

You will need a Windows computer (Linux may also work but you'll have to find another mirror for SixaxisPairTool or build an equivalent tool from source), an ESP32, a PS3 Controller, Micro-USB cable, and Mini-USB cable to connect to the ESP32 and PS3 Controller, respectively.

We used the Arduino IDE for our programming when developing this. Information on setting up the Arduino IDE for ESP32 development can be found here. After getting the board installed in your IDE, you will need to move the code in the src folder in this repo to a new folder under libraries in your Arduino installation. Then go to Sketch->Include Library and find whatever you named the new folder in the libraries list. It should show up under Contributed Libraries. This should include the required header files. You will also need to install this library and this library as they are required dependencies for this software.

After setting up your IDE, you should download SixaxisPairTool from this link. This allows you to modify the saved MAC address inside your PS3 controller to connect it to the ESP32. Change it to an available MAC you would like to use. Then, when using the GameController class, simply pass the MAC address in the controller as a string in the constructor, separating each byte with a colon.

You should be good to go to begin your development with the motor controllers and the ESP32! Examples coming soon.

Limitations

This code will run a very minimalist robot, with only basic motor and controller support, in addition to crude encoder support. More features may be added in the future, but as of now more complicated features like PID control, gyroscopes, etc. are up to you to implement.

esp32-robot-controller's People

Contributors

nastark123 avatar

Watchers

 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.