Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <L298N.h>
- //pin definition
- #define EN1 9
- #define IN1 4
- #define IN2 5
- #define EN2 10
- #define IN3 6
- #define IN4 7
- //create a motor instance
- L298N motor1(EN1,IN1,IN2);
- L298N motor2(EN2,IN3,IN4);
- void setup() {
- //used for display information
- Serial.begin(9600);
- motor1.setSpeed(175); // an integer between 0 and 255
- motor2.setSpeed(175);
- }
- void loop() {
- motor1.forward();
- motor2.forward();
- }
Add Comment
Please, Sign In to add comment