Skip to content

Commit

Permalink
Committed release v1.0.1
Browse files Browse the repository at this point in the history
See the changelog for more details
  • Loading branch information
HackerInside0 committed Sep 13, 2016
1 parent 57ecfc4 commit bbc30eb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 10 deletions.
41 changes: 36 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,41 @@
# L293
Library for the control of bidirectional motors and not by the integrated circuit L293

Created by Giuseppe Masino, 28 may 2016
Author URL http://www.facebook.com/peppe.masino1
Compatible architecture: ALL

##Description

Library that allows to control bidirectional motors using the L293 IC

##Sintax & short command reference

- Creating an istance

*L293(pwmPin, forwardPin, backPin);*
*L293(pwmPin, forwardPin, backPin, speedOffset);*

**L293** : the name of the object
**pwmPin** : the pin that generate the pwm signal used to control the motor speed
**forwardPin** : the digital pin used to tell the motor to go forward
**backpin** : the digital pin used to tell the motor to go reverse
**speedOffset** : the offset value applied to the pwm signal value, used to reduce the power given to a motor
(e.g. in a robot two motors must rotate at the same speed, but one is more powerful than other)

- Moving the motor

***L293.forward(speed);*** : makes the motor to go forward, **speed** can be a value between -255 and 255

***L293.back(speed);*** : makes the motor to go reverse, **speed** can be a value between -255 and 255

***L293.stop();*** : stops the motor

***L293.setSpeedOffset(speedOffset);*** : Used to set a new speed offset value after the creation of the istance

##About the author & license info

Created by ***Giuseppe Masino, 28 may 2016***
Author URL: http://www.facebook.com/peppe.masino1

This library and the relative example files are released under the license
CreativeCommons Attribution-ShareAlike 4.0 International
**CreativeCommons Attribution-ShareAlike 4.0 International

License info: http://creativecommons.org/licenses/by-sa/4.0/
License info: http://creativecommons.org/licenses/by-sa/4.0/
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name=L293
version=1.0.0
version=1.0.1
author=Giuseppe Masino <http://www.facebook.com/peppe.masino1>
maintainer=Giuseppe Masino <http://www.facebook.com/peppe.masino1>
sentence=Allow to control brushless motors with L293 motor driver
paragraph=
category=Device Control
url=https://github.com/HackerInside0/L293.git
url=https://github.com/HackerInside0/Arduino_L293.git
architectures=*
dot_a_linkage=true
includes=L293.h
2 changes: 0 additions & 2 deletions src/L293.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ void L293::forward(uint8_t _pwm)

void L293::back(uint8_t _pwm)
{
if(reversePin == 255) return this->forward(_pwm);
this->stop();
digitalWrite(reversePin, HIGH);
analogWrite(enablePin, _pwm + speedOffset);
Expand All @@ -45,7 +44,6 @@ void L293::stop()
{
analogWrite(enablePin, 0);
digitalWrite(forwardPin, LOW);
if(reversePin != 255) digitalWrite(reversePin, LOW);
}

void L293::setSpeedOffset(uint8_t _speedOffset)
Expand Down
2 changes: 1 addition & 1 deletion src/L293.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class L293
void stop(void);
void setSpeedOffset(byte _speedOffset);

private:
protected:

uint8_t enablePin, forwardPin, reversePin, speedOffset;
};
Expand Down

0 comments on commit bbc30eb

Please sign in to comment.