Adafruit Motor Shield V2.0 Скачать руководство пользователя страница 8

    digitalWrite(10, HIGH);  

    stepper.step(steps);  

    digitalWrite(9, LOW);  

    digitalWrite(10, LOW);  

}  

 

void

 

setup

()  

{  

    

// set the speed of the motor to 30 RPMs

 

    pinMode(9, OUTPUT);  

    pinMode(10, OUTPUT);  

    digitalWrite(9, LOW);  

    digitalWrite(10, LOW);  

    stepper.setSpeed(30);  

}  

 

void

 

loop

()  

{  

    step(1000);  

    step(-1000);  

}  

 

// END FILE

 

If there’s nothing happen, please double check if you had connected the wire right. 

Library APIs 

begin 

Description

 

void 

begin

();  

 

 

Содержание Motor Shield V2.0

Страница 1: ... L298 it is able to drive two DC motors or a step motor The Motor Shield can either be powered directly by Arduino or by an external 6V 15V power supply via the terminal input This module can be used for the development of micro robots and intelligent vehicles etc Features Standard Arduino UNO Shield pin out Based on L298 full bridge IC Drive 2 DC Motor or 1 Stepper External power input available ...

Страница 2: ...nels 4 Ports Hardware Overview 1 Channel 1 indicator include 3 leds EB channel 1 enable high active IN3 status of OUT3 IN4 status of OUT4 2 Channel 1 Sense Please connect the left 2 pins together for normal usage Note that it s a high level application for sense the current please refer to datasheet and schematic for more information ...

Страница 3: ...ut range 6 15V 7 Reset indicator turn red when Reset button is pressed 8 Reset button pressed to reset the shield and Arduino 9 Power indicator turn green when power in either internal or external A Power switch Connect Get power from Arduino Disconnect Get power from External sources B Standard Arduino shield pin out Digital Pin Used Arduino Pin Function D0 Not Used D1 Not Used D2 Not Used D3 Not...

Страница 4: ...ot Used D4 Not Used D5 Not Used Note Not Used means you can use those pins freely Getting Started Here we will show you how to drive a dc motor and a stepper with this shield We need a Seeeduino V4 as the controller Seeeduino V4 is an Arduino compatible board and you can use an Arduino as well And you need a dc motor or a stepper for testing Download the library Click the below button to download ...

Страница 5: ...r with a jumper Connect MB_EN together with a jumper as we are no going use an external power Connect your DC motor to Chanel 0 OUT1 and OUT2 Then open motor_dc example in the library Upload the code to Seeeduino V4 2 Demo function The application method to drive the DC motor Author Loovee luweicong seeed cc 2016 3 11 include MotorDriver h MotorDriver motor void setup initialize motor begin ...

Страница 6: ... stop 0 stop delay 1000 END FILE Then you will find your motor move 1s stop 1s move back 1s stop 1s and loop If there s nothing happen please make sure You had uploaded the code successfully Your motor connect right The led indicators blink right Drive a Stepper You can drive a 4 wire stepper with this shield Here I will show you how to drive a stepper ...

Страница 7: ...2 B OUT3 B OUT4 Then open stepper_test example in the library upload it to Seeeduino V4 then you will find your stepper move Stepper test for Seeed Motor Shield V2 loovee 15 Mar 2016 include Stepper h change this to the number of steps on your motor define STEPS 200 create an instance of the stepper class specifying the number of steps of the motor and the pins it s attached to Stepper stepper STE...

Страница 8: ...et the speed of the motor to 30 RPMs pinMode 9 OUTPUT pinMode 10 OUTPUT digitalWrite 9 LOW digitalWrite 10 LOW stepper setSpeed 30 void loop step 1000 step 1000 END FILE If there s nothing happen please double check if you had connected the wire right Library APIs begin Description void begin ...

Страница 9: ...Chanel 0 1 Chanel 1 speed 100 100 the larger the faster 0 for stop stop void stop unsigned char motor_id brake void brake unsigned char motor_id Stepper Note that we use the library provided by Arduino IDE to drive a stepper There s something need to be modified please refer the examples ...

Отзывы: