Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
LineFollowingRobot/L298_H.h
- Committer:
- Nicolaemf
- Date:
- 2019-03-14
- Revision:
- 7:b9c2097e5cb2
- Parent:
- 6:b457f1e2fff8
File content as of revision 7:b9c2097e5cb2:
#ifndef L298_H #define L298_H #include <mbed.h> //RobotControl is used to control the direction and speed of the robot //attributes : the pinouts of the enable and pwm forward and backwards //methods : SetSpeed and SetDirection to set speed and set direction class L298 { private: DigitalOut m_motorBw; DigitalOut m_motorFw; PwmOut m_motorEnable; bool m_prevDir; public: bool m_dir; float m_speed; L298(PinName pin1, PinName pin2, PinName pin3); //initializes the pins, direction and speed void SetDirection(bool dir); //sets direction of robot, forward or backwards void SetSpeed(float speed); //sets speed of robot regardless of direction }; #endif