gabbyshimoni icon

runDCmotorL298n

gabbyshimoni | PRO | 01/29/19 05:58:45 PM UTC | 0 ⭐ | 414 👁️ | Never ⏰ | []
C++ |

460 B

|

None

|

0 👍

/

0 👎

/*
 * 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