Arduino library for controlling the movements of a 2wd robotic car using a H-bridge motor driver L298P

RoboticCar

Arduino library for controlling the movements of a 2wd robotic car using a H-bridge motor driver L298P

Install the library

Download this repository as a .zip file and from the Arduino IDE go to Sketch -> Include library -> Add .ZIP Library Then insert the "include statement" in your code:

#include <RoboticCar.h>

And create an instance of the library:

RoboticCar car(pwm1, dir1, pwm2, dir2);

Where:

  • pwm1 is pwm pin to control the speed of motor 1
  • dir1 is a pin to control the direction (forward or backward) of motor 1
  • pwm2 is pwm pin to control the speed of motor 2
  • dir2 is a pin to control the direction (forward or backward) of motor 2

Methods

To drive the car forwards or backwards, use the methods:

car.goAhead(speed);

or

car.goBack(speed);

Where speed is the pwm valued (0 to 100).

To turn the car to the right or left, use the methods:

car.turnRight(speed);

or

car.turnLeft(speed);

Where speed is the pwm valued (0 to 100).

It is also possible to rotate the car on its axis through the methods: car.rotateRight(speed);

or

car.rotateLeft(speed);

Where speed is the pwm valued (0 to 100).

To stop the car simply use: car.stop();

Here is also the possibility of creating custom movements, passing the speed and direction of each motor, using the command: car.customDirection(pwm1, dir1, pwm2, dir2);

For more information see the examples.

Feedback

Version 0.2.1 Beta Release. Your feedback is important. Register an issue to request a modification to this software.

Thanks!

Prototype

Owner
José Augusto Cintra
Software developer focused on Mathematics, IoT and Games.
José Augusto Cintra
Similar Resources

Arduino GPS Car Tracking with GPRS/HTTP

 Arduino GPS Car Tracking with GPRS/HTTP

Arduino GPS Car Tracking with GPRS/HTTP this is a simple car tracking source and module to start hacking around Overview Overview DIY Module Features

Nov 26, 2021

Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.

Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.

CosMapper Loads a signed kernel driver (signed with leaked cert) which allows you to map any driver to kernel mode without any traces of the signed /

Jan 2, 2023

Control of 4 DOF robotic arm using Bluetooth HC-05 Sensor

Control of 4 DOF robotic arm using Bluetooth HC-05 Sensor

SERV-E - "At your Service" Problem Statement With the current boom of technology where the whole world is running towards digitisation and automation

Apr 27, 2022

Simple Stepper Motor Analyzer

 Simple Stepper Motor Analyzer

A DYI stepper motor analyzer. This is a new design that is based on Raspberry Pi Pico and users a compact single PCB design. NOTE: The legacy STM32 based stepper analyzer was moved to this repository https://github.com/zapta/legacy_stepper_motor_analyzer.

Jan 1, 2023

Design and firmware for a stepper motor retrofit to the often-failed AC synchronous flip clock motors

StepperFlipClock Design and firmware for a stepper motor retrofit to the often-failed AC synchronous flip clock motors. Flip clocks, perhaps most icon

Oct 13, 2022

Contains firmware and software used for the bead sprite printer v2 robotic system

Bead-Sprite-Printer-V2 Contains firmware and software used for the bead sprite printer v2 robotic system bead_fuser_arduino - this folder contains the

Dec 29, 2022

Another try to re-create Project Astoria , or some bridge between A and W...

Bridge 1.0.10.0 Forked from: https://github.com/DroidOnUWP/Bridge Abstract Another "Project Astoria" remake (UWP) Original status: Forgotten (?) My ac

Nov 15, 2022

2D/3D Registration and system integration for image-based navigation of orthopedic robotic applications, inculding femoroplasty, osteonecrosis, etc.

Registration and System Integration Software for Orthopedic Surgical Robotic System This repository contains software programs for image-based registr

Sep 3, 2022

This package contains the common algorithms in robotic arm, and I have developed it based on universal robot. It will be continuously updateing.

This package contains the common algorithms in robotic arm, and I have developed it based on universal robot. It will be continuously updateing.

Robotic_Arm_Algorithms It contains the common algorithms in robotic arm, and will be recording the development as soon as I have completed the any one

Dec 21, 2022
sc-ble-bridge is a utility that for every connected Steam Controller creates a virtual one acting as a bridge between SC and Steam

sc-ble-bridge The main goal of this utility is to provide workaround for steam-for-linux issue which makes Valve's Steam Controller unusable in BLE mo

Apr 19, 2022
Pico-uart-bridge - Raspberry Pi Pico UART-USB bridge

Raspberry Pi Pico USB-UART Bridge This program bridges the Raspberry Pi Pico HW UARTs to two independent USB CDC serial devices in order to behave lik

Dec 23, 2022
Iot-Surveillance-Car - This is a IOT Based Surveillance Car which can be controlled, tracked globally as well as its data can be accessed globally

Iot-Surveillance-Car - This is a IOT Based Surveillance Car which can be controlled, tracked globally as well as its data can be accessed globally. The camera on the front of the car can also be monitored globally. It can go anywhere where sim connection is available. 5th Sem Mini project

Dec 3, 2022
4 channel servo controller code for Arduino Mega 2560 for AASD-15A and similar motor driver

eh-msc-4dof 4 channel servo controller code for Arduino Mega 2560 for AASD-15A and similar motor driver Arduino sketch for generating pulses needed to

Sep 9, 2022
VEX v5 Pro program that records driver movements and plays them back during the autonomous period.

Autonomous Recorder This code was written for team 5588R, but it can be easily modified to work with your team's robot. Notes Code isn't fully finishe

Jun 21, 2022
The movements of your RC vehicles are jerky and not smooth? This Arduino device will solve this issue by adding acceleration and deceleration ramps to the PWM signals!
The movements of your RC vehicles are jerky and not smooth? This Arduino device will solve this issue by adding acceleration and deceleration ramps to the PWM signals!

This is an Arduino Pro Mini 3.3V / 8MHz based RC servo ramp / delay generator Features: 4 RC servo PWM inputs and outputs (can be enhanced) Reads the

Apr 15, 2022
This is for interfacing rasberry-pi's (2 cards) with an arduino for sending raw data to form the close loop system to avoid motor heating by acting on a given temperature.

This is for interfacing rasberry-pi's (2 cards) with an arduino for sending raw data to form the close loop system to avoid motor heating by acting on a given temperature. Interface is explained through a master slave approach and client server approach. another camera is used with OPEN-CV platform to interface and collect data aswell.

Oct 25, 2021
Simple tool to visualize and amplify mouse movements
Simple tool to visualize and amplify mouse movements

mousemic Simple tool to visualize and amplify mouse movements. This utility uses a high-level X11 Api so is not really more sensitive than your screen

Nov 25, 2022
Controlling Servos with a Esp-wroom-32 via MQTT with an Android Client

esp32_servos_mqtt Controlling Servos with a Esp-wroom-32 via MQTT with an Android Client Added two files, first is the schematic for the connection wi

Oct 7, 2022
Lean4 port of Arduino balance car controller
Lean4 port of Arduino balance car controller

lean4-balance-car This is a small proof-of-concept exercise to show a Lean 4 program controlling a real robotics platform which requires low latency c

Jul 11, 2022