/*
* 29/01/2019
* Written by: Shimoni Gabby
* Description:
* The program run a DC motor full speed in one direction via L298n motor driver
*/
#define motor1Pin 5
#define motor2Pin 6
void setup() {
pinMode(motor1Pin,OUTPUT);
pinMode(motor2Pin,OUTPUT);
}
void loop() {
//start motor
digitalWrite(motor1Pin,HIGH);
digitalWrite(motor1Pin,LOW);
delay(3000);
// stop motor
digitalWrite(motor1Pin,HIGH);
digitalWrite(motor2Pin,HIGH);
}
Comments