background image

 

 

 
 

 5 

 

  // disable motor output by setting all INx pins high 
  digitalWrite(in1, HIGH);  
  digitalWrite(in2, HIGH); 
  digitalWrite(in3, HIGH); 
  digitalWrite(in4, HIGH); 
 

 
void loop() { 
 
  digitalWrite(in1, LOW); // Turn on motor A in direction 1 
  delay(2000); 
  digitalWrite(in1, HIGH); // Turn off motor A in direction 1 
  digitalWrite(in2, LOW); // Turn on motor A in direction 2 
  delay(2000); 
  digitalWrite(in2, HIGH); // Turn off motor A in direction 2 
 
  digitalWrite(in3, LOW); // Turn on motor B in direction 1 
  delay(2000); 
  digitalWrite(in3, HIGH); // Turn off motor B in direction 1 
  digitalWrite(in4, LOW); // Turn on motor B in direction 2 
  delay(2000); 
  digitalWrite(in4, HIGH); // Turn off motor B in direction 2 
   

 

2-Phase Stepper Motor 

 

 

 

 

 

  This demo will test the motor controller board by running a connected stepper motor in 
each direction for a full revolution. 
  See whadda.com for the manual which includes a wiring diagram 
   
 */ 
 
 
// Include the Arduino Stepper Library 
#include <Stepper.h> 
 
// Number of steps per output rotation 

Summary of Contents for L298N

Page 1: ...USER MANUAL EN L298N dual bridge DC and stepper motor controller board WPI409 whadda com ...

Page 2: ...sons with reduced physical sensory or mental capabilities or lack of experience and knowledge if they have been given supervision or instruction concerning the use of the device in a safe way and understand the hazards involved Children shall not play with the device Cleaning and user maintenance shall not be made by children without supervision General Guidelines Refer to the Velleman Service and...

Page 3: ...ine Surf to www arduino cc for more information Product Overview This module allows full control of two DC motors or one stepper motor Specifications driver L298N driver power supply 5 35 V driver output current max 2 A logic power output Vss 5 7 V internal supply 5 V logic current 0 36 mA controlling level low 0 3 V to 1 5 V high 2 3 V Vss enable signal level low 0 3 V to 1 5 V high 2 3 V Vss max...

Page 4: ...d the power is supplied by the 5 V port when the jumper is disabled Example 2 Stepper DC Motor This demo will test the motor controller board by running two connected DC motors in each direction for 2 seconds See whadda com for the manual which includes a wiring diagram int in1 13 IN1 connected to digital pin 13 int in2 12 IN2 connected to digital pin 12 int in3 11 IN3 connected to digital pin 11 ...

Page 5: ...off motor A in direction 2 digitalWrite in3 LOW Turn on motor B in direction 1 delay 2000 digitalWrite in3 HIGH Turn off motor B in direction 1 digitalWrite in4 LOW Turn on motor B in direction 2 delay 2000 digitalWrite in4 HIGH Turn off motor B in direction 2 2 Phase Stepper Motor This demo will test the motor controller board by running a connected stepper motor in each direction for a full revo...

Page 6: ...p set the speed at 60 rpm myStepper setSpeed 60 initialize the serial port Serial begin 9600 void loop step one revolution in one direction Serial println clockwise myStepper step stepsPerRevolution delay 500 step one revolution in the other direction Serial println counterclockwise myStepper step stepsPerRevolution delay 500 ...

Page 7: ...7 whadda com Modifications and typographical errors reserved Velleman Group nv WPI409_v01 Velleman Group nv Legen Heirweg 33 9890 Gavere ...

Reviews: