|
1 | 1 | # L293 # |
2 | 2 |
|
3 | | -Compatible architecture: ALL |
| 3 | + |
| 4 | +[](https://github.com/qub1750ul/Arduino_L293/blob/master/LICENSE.md) |
| 5 | +[](https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification) |
| 6 | +[](https://www.arduino.cc/en/Main/Software) |
| 7 | +[](http://keepachangelog.com) |
| 8 | +[](http://semver.org) |
4 | 9 |
|
5 | | -## Description ## |
6 | | - |
7 | | -Library that allows to control bidirectional motors using the L293 IC in two different hardware configurations: |
8 | | - |
9 | | -- standalone |
10 | | -- twoWire |
11 | | - |
12 | | -### standalone configuration ### |
13 | | - |
14 | | -This configuration in intended for use with a standalone L293 IC and breakout boards that expose the ENABLE pin and the two INPUTS, using 3 wires for each motor to control ( excluding the power supply ). |
15 | | -The circuit must be like this: |
16 | | - |
17 | | - |
18 | | -### twoWire configuration ### |
19 | | - |
20 | | -This configuration is intended for use with a circuit like this: |
21 | | - |
| 10 | +An Arduino library that allows to control bidirectional motors using the L293 IC and compatible L298 boards. |
22 | 11 |
|
23 | | -Where only two wires are used to control the motor: the PWM signal and the direction signal ( excluding the power supply ) |
24 | | - |
25 | | -## Sintax & short command reference ## |
26 | | -### Common reference ### |
27 | | - |
28 | | -- Moving the motor |
29 | | - |
30 | | - ***motor.forward(speed);*** : makes the motor to go forward, **speed** can be a value beetween 0 and 255 |
31 | | - ***motor.forward();*** : makes the motor to go forward without modifing the speed |
32 | | - ***motor.back(speed);*** : makes the motor to go reverse, **speed** can be a value beetween 0 and 255 |
33 | | - ***motor.back();*** : makes the motor to go reverse without modifing the speed |
34 | | - ***motor.stop();*** : stops the motor |
35 | | - ***motor.setPWMOffset(speedOffset);*** : sets the offset value applied to the pwm signal value, **speedOffset** can be a value beetween -255 and 255 |
36 | | - ***motor.getRawPWMDC();*** : returns the current speed value whitout appling the speed offset |
37 | | - ***motor.getPWMDC();*** : returns the real current speed value |
38 | | - ***motor.getDirection();*** : return an integer representing the status of the motor: |
39 | | - - 0 : the motor is going forward |
40 | | - - 1 : the motor is going reverse |
41 | | - - 3 : the motor is braked |
42 | | - - 4 : unknown status |
43 | | - |
44 | | -### Reference for the standalone configuration only ### |
45 | | - |
46 | | -- Creating an istance |
47 | | - |
48 | | - *L293 motor(pwmPin, forwardPin, backPin);* |
49 | | - *L293 motor(pwmPin, forwardPin, backPin, speedOffset);* |
50 | | - |
51 | | - **motor** : the name of the object |
52 | | - **pwmPin** : the pin that generate the pwm signal used to control the motor speed |
53 | | - **forwardPin** : the digital pin used to tell the motor to go forward |
54 | | - **backpin** : the digital pin used to tell the motor to go reverse |
55 | | - **speedOffset** : the offset value applied to the pwm signal value, used to reduce the power given to a motor (can be a value beetween -255 and 255) (e.g. in a robot two motors must rotate at the same speed, but one is more powerful than other) |
56 | | - |
57 | | -- Moving the motor |
58 | | - |
59 | | - **motor.forceStop(handlingTime);** : stops the motor electically braking it, **handlingTime** is the time in milliseconds during which the motor is braked, the recommended value is 100 |
60 | | - |
61 | | -### Reference for the L293_twoWire configuration only ### |
| 12 | +## Description ## |
62 | 13 |
|
63 | | -- Creating an istance |
| 14 | +This library is designed to make easy the control of bidirectional motors either for beginners or for experts, providing a level of abstraction over the direct "lower-level" management of the MCU I/O ports that drive the H-bridge(s). |
64 | 15 |
|
65 | | - *L293_twoWire motor(pwmPin, directionPin);* |
66 | | - *L293_twoWire motor(pwmPin, directionPin, speedOffset);* |
67 | | - |
68 | | - **motor** : the name of the object |
69 | | - **pwmPin** : the pin that generate the pwm signal used to control the motor speed |
70 | | - **directionPin** : the digital pin used to manage the motor direction |
71 | | - **speedOffset** : the offset value applied to the pwm signal value, used to reduce the power given to a motor (can be a value beetween -255 and 255) |
72 | | - (e.g. in a robot two motors must rotate at the same speed, but one is more powerful than other) |
| 16 | +This means that the programmer haven't to care about the implementation of the control code and timings and can focus on the desired behavior. |
73 | 17 |
|
| 18 | +The main goal of this library is to be simple to use for beginners but flexible for experts. |
74 | 19 |
|
| 20 | +[Checkout the wiki for more information](https://github.com/qub1750ul/Arduino_L293/wiki/) |
75 | 21 |
|
76 | | -## About the author & license info |
| 22 | +## About the author & license info ## |
77 | 23 |
|
78 | 24 | <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"> |
79 | 25 | <img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /> |
80 | 26 | </a> |
81 | 27 | <br /> |
82 | | -<span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">The L293 Library</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/HackerInside0/Arduino_L293" property="cc:attributionName" rel="cc:attributionURL">Giuseppe Masino</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a> and also under the following terms: |
| 28 | +<span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">The L293 Library</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://facebook.com/dev.giuseppemasino" property="cc:attributionName" rel="cc:attributionURL">Giuseppe Masino</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a> and also under the following terms: |
83 | 29 |
|
84 | | -The softwares, source files, schematics and all other material are provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular scope and noninfringement. |
| 30 | +The softwares, source files, schematics and all other material are provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular scope and noninfringement. |
85 | 31 |
|
86 | | -In no event shall me and/or other peopole that holds the rights and/or are implied in the creation and distribution of the above mentioned things be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising form, out of or in connection with the above mentioned things or the use or other dealings in it. |
| 32 | +In no event shall me and/or other peopole that holds the rights and/or are implied in the creation and distribution of the above mentioned things be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising form, out of or in connection with the above mentioned things or the use or other dealings in it. |
87 | 33 |
|
88 | | -The above copyright notice and this permission notice shall accompany and/or be included ( depending on the type of work ) in all the derived works from mine, as addendum to compliance with the provisions above. |
| 34 | +The above copyright notice and this permission notice shall accompany and/or be included ( depending on the type of work ) in all the derived works from mine, as addendum to compliance with the provisions above. |
89 | 35 |
|
90 | 36 | If you need permissions that are beyond the scope of this license, you can ask to me through this facebook page <a xmlns:cc="http://creativecommons.org/ns#" href="https://www.facebook.com/dev.hackerinside/" rel="cc:morePermissions">https://www.facebook.com/dev.hackerinside/</a> |
91 | 37 |
|
92 | | -The text of this license can also be found in the LICENSE.md file |
| 38 | +The text of this license can also be found in the LICENSE.md file |
0 commit comments