Giter Site home page Giter Site logo

differentialbot's Introduction

DifferentialBot

An arduino class to control differential robots

Usage

To install the library simply copy it to the "sketchbook/libraries/" folder. To use it include it in your sketch

#include <DifferentialBot.h>

DifferentialBot myRobot(motL1,motL2,motR1,motR2,minSpeed,maxSpeed);

and call the function

myRobot.drive(x,y);

The variables motL1, motL2, motR1 and motR2 are the pins each of the motors are connected to, while minSpeed and maxSpeed are the minimum and maximum pwm values to be able to start turning the motors and to limit the robot's speed, respectively.

The drive function has two operating modes which can be chosen with the last parameter, such as

myRobot.drive(x,y);
myRobot.drive(x,y,1);

The difference is in the transition from "forward-(counter)clockwise" to "(counter)clockwise" to "backwards-(counter)clockwise". In the first example, there is no direct "(counter)clockwise" rotation and the other transition along a curve, like a car would.This is the default behaviour. In the second, the transition is done by maintaining its rotation sens. For example, where if the first command were to yield a "backwards-clockwise", the second one would output a "backwards-counterclockwise".

differentialbot's People

Contributors

alvaroferran avatar

Stargazers

天宇 avatar

Watchers

James Cloos avatar  avatar

Forkers

marciopocebon

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.