MyRobot - Made To Control A Whole Robot

MyRobot - Made To Control A Whole Robot © GPL3+

Created to be a whole Robot controller that uses the Arduino Hardware in general, for a while. This looks to improve the code way.

  • 5,876 views
  • 1 comment
  • 17 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
All the Arduino boards supports
×1
11769 06
SparkFun RedBot Sensor - Line Follower
Any other digital sensor like line follwer works too.
×1
51gzz5eu9pl. sx425
Ultrasonic Sensor - HC-SR04 (Generic)
For the ultrasonic sensor
×1
Rg cont a
RobotGeek Continuous Rotation Servo
Some Servo with continuous rotation
×1

Apps and online services

Ide web
Arduino IDE
Some IDE need that run .ino code

About this project

Introduction

MyRobot is a library for the Arduino Platform. The intention is to be a complete robot controller that uses the Arduino Hardware Platform in general. This looks to improve code writing, making it faster, easier to use and makes use of a simple and readable syntax, since any kind of logic that involves code development is being done by lib, from mathematical calculations needed to Motor movements. The user will only have to worry about making the necessary and correctly made wiring.

API

Here it is listed all the functions and functionalities that lib is available to the user. Remembering that the entire development process is still in progress, so take into account any other update or modification that may occur in the API.

Servos

To configure the servo motors:

void servos(unsigned int esqPin, unsigned int dirPin); 

Two pins are connected to the servos.

Analog Sensors

To configure analog sensors:

void analogSensors(int pins [], uint8_t STATE); 

Passed an array of pins and the I / O state (Input or Output) of the sensor.

Digital Sensors

To configure the digital sensors:

void digitalSensors(int pins []; uint8_t STATE); 

Ultrasound

To configure the Ultrasonic sensors:

void ultra(unsigned int TrigPin, unsigned int EchoPin); 

Two pins are connected to the ultrasonic sensor.

Usage

The basic usage for this in an Arduino code, looks like this:

#include <MyRobot.h>
MyRobot bot;
int AnalogPins[4] = { 0, 1, 2, 3 };
 
void setup() {
  Serial.begin(9600);
  // Initializing some basic stuff like pins and states:
  bot.servo(10, 11);
  bot.ultra(12, 13);
  bot.analogSensors(AnalogPins, INPUT);
}
 
void loop() {
  // Using servos:
  bot.goAhead();
  delay(300);
  bot.stopServo();
 
  // Using Ultrassonic:
  Serial.println( bot.getDistancia() );
  // Using Analog Sensor:
  Serial.println( bot.getAnalogRead(AnalogPins[0]) );
}

Examples

You can check some examples from the repository in Github, where the lib source code is hosted. Click here to go to the examples.

Contribute

This is a totally open-source project, so do not hesitate to send us your suggestions by adding issues to the Github repository by clicking here. Also help with pull requests development, all help is welcome.

And keep coding doing awesome things :)

Code

Schematics

Comments

Similar projects you might like

Line Follower Robot - PID Control - Android Setup

Project tutorial by MJRoBot

  • 28,053 views
  • 7 comments
  • 33 respects

Arduino Robot w/ GoPro and FPV iPhone Control via Bluetooth

Project in progress by AlxArd

  • 3,146 views
  • 5 comments
  • 24 respects

PID Control Line Follower Robot

Project tutorial by Team KittenBot

  • 14,311 views
  • 5 comments
  • 25 respects

PHPoC - Arduino Self Balancing Robot with BT+Web Control

Project in progress by Suyog Gunjal

  • 3,688 views
  • 2 comments
  • 23 respects

MeArm Robot Arm - Your Robot - V1.0

Project tutorial by Benjamin Gray

  • 19,304 views
  • 3 comments
  • 35 respects
Add projectSign up / Login