This is a library for the L293D motor controller shield based on AFMotor.h library customized for the Robotics Workshop of the Computer Engineering Department of TIP-QC.
This was made for a Robot that has 2 Brushed DC Motors, two IR Sensors, and an Ultrasonic Sensor(library will support this in a future release).
You can read here or go to the web page roycechua23.github.io/MotorControllerShieldCPE-QC/
To use this library you must
1. Download AFMotor.h library from Adafruit wbich you can conveniently download on the Arduino IDE by clicking Sketch then Include Libaries
2. Then download the Adafruit Motor Shield V1
3. Clone this repository or Download as ZIP, if you cloned this repository make sure to move it to the Arduino library location (ex. C:\Users<Username>\Documents\Arduino\libraries for Windows) OR if you downloaded this repository as a ZIP file, extract it then move it to the Arduino library location.
The two libraries should be present in the Arduino library folder like the one below.
4. MotorControllerShieldCPE-QC library's example should now be present in the Arduino IDE through File -> Examples -> MotorControllerShieldCPE-QC. You should be able to see 3 examples.
Example of the Robot Navigation codes
Remember to create an instance of Controller.
Controller bot = Controller();
For robot navigation, these are the functions available
bot.moveForward(speedmotorA, speedMotorB) // from 0-255
bot.moveBackward(speedmotorA, speedMotorB) // from 0-255
bot.moveLeft(speedmotorA, speedMotorB) // from 0-255
bot.moveRight(speedmotorA, speedMotorB) // from 0-255
To read data from the IR sensor
bot.ReadSensorVal1()
bot.ReadSensorVal2()
Having trouble with the library? Just send an email to [email protected] and we’ll help you sort it out.
This repository is under MIT License.