Difference between revisions of ""Adafruit Motor Shield v2""

From Let's Control It
Jump to navigation Jump to search
Line 33: Line 33:
 
   http://<ESP IP address>/control?cmd=MotorShieldCMD,DCMotor,<Motornumber>,<Forward/Backward/Release>,<Speed>
 
   http://<ESP IP address>/control?cmd=MotorShieldCMD,DCMotor,<Motornumber>,<Forward/Backward/Release>,<Speed>
  
For Steppers: ('''not fully implemented!!''')
+
For Steppers:
  
 
   http://<ESP IP address>/control?cmd=MotorShieldCMD,Stepper,<Motornumber>,<Forward/Backward/Release>,<Steps>,<SINGLE/DOUBLE/INTERLEAVE/MICROSTEP>
 
   http://<ESP IP address>/control?cmd=MotorShieldCMD,Stepper,<Motornumber>,<Forward/Backward/Release>,<Steps>,<SINGLE/DOUBLE/INTERLEAVE/MICROSTEP>

Revision as of 09:42, 17 March 2017

Introduction

This Plugin in currently only available in the latest mega build github

This Plugin is for the Adafruit Motor Shield v2 which is controlled over the I2C protocol. To Connect it to ESP8266 devices (e.g. Wemos D1 R2) you have to set it to 3.3 V, see adafruit documentation for that.

Hardware

This Plugin works with the v2 version of the Adafruit Motor Shield v2: Support the great developer of this board with buying it from them! (you will also find cheaper clones on Aliexpress, which also work with this plugin)

Adafruit motorshield v2.jpg

This Picture shows a clone board.

Software

The Plugin is heavily based on Adafruits own Library


ESP Easy

Use the device tab on the ESP Easy webinterface and create a new task by editing one of the available tasks. Select "Adafruit Motor Shield v2" from the dropdown box.

Enter the i2c address of you sensor, default value 0x60 Currently only the Motortype "DC Motor" is implemented!

Motor shield settings.jpg

Controlling the Motor Shield via HTTP commands

You can control the Motorshield by remote http commands send from your Home Automation Controller or any other device that can send http get requests.

Command format:

For DC Motors:

 http://<ESP IP address>/control?cmd=MotorShieldCMD,DCMotor,<Motornumber>,<Forward/Backward/Release>,<Speed>

For Steppers:

 http://<ESP IP address>/control?cmd=MotorShieldCMD,Stepper,<Motornumber>,<Forward/Backward/Release>,<Steps>,<SINGLE/DOUBLE/INTERLEAVE/MICROSTEP>

Examples: Turn on DC Motor, Direction: Forward. Speed is a value from 0-255

 http://<ESP IP address>/control?cmd=MotorShieldCMD,DCMotor,1,Forward,255

Stopping the DC Motor:

 http://<ESP IP address>/control?cmd=MotorShieldCMD,DCMotor,1,Release