![oddWires IoT-Bus Скачать руководство пользователя страница 88](http://html1.mh-extra.com/html/oddwires/iot-bus/iot-bus_documentation_3330893088.webp)
iot-bus Documentation, Release latest
(continued from previous page)
myMotor
->
step(
100
, FORWARD, DOUBLE);
myMotor
->
step(
100
, BACKWARD, DOUBLE);
Serial.println(
"Interleave coil steps"
);
myMotor
->
step(
100
, FORWARD, INTERLEAVE);
myMotor
->
step(
100
, BACKWARD, INTERLEAVE);
Serial.println(
"Microstep steps"
);
myMotor
->
step(
50
, FORWARD, MICROSTEP);
myMotor
->
step(
50
, BACKWARD, MICROSTEP);
Move the stepper motor forward and backward in different ways. The full example is shown beow.
/*
This is a test sketch for the iot-bus motor board
*/
#include
<Wire.h>
#include
<Adafruit_MotorShield.h>
#include
"utility/Adafruit_MS_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS
=
Adafruit_MotorShield(
0x5F
);
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor
*
myMotor
=
AFMS.getStepper(
200
,
1
);
void
setup
() {
Serial.begin(
115200
);
Serial.println(
"Stepper test!"
);
AFMS.begin();
// create with the default frequency 1.6KHz
//AFMS.begin(1000);
// OR with a different frequency, say 1KHz
myMotor
->
setSpeed(
10
);
// 10 rpm
}
void
loop
() {
Serial.println(
"Single coil steps"
);
myMotor
->
step(
100
, FORWARD, SINGLE);
myMotor
->
step(
100
, BACKWARD, SINGLE);
Serial.println(
"Double coil steps"
);
myMotor
->
step(
100
, FORWARD, DOUBLE);
myMotor
->
step(
100
, BACKWARD, DOUBLE);
Serial.println(
"Interleave coil steps"
);
myMotor
->
step(
100
, FORWARD, INTERLEAVE);
myMotor
->
step(
100
, BACKWARD, INTERLEAVE);
Serial.println(
"Microstep steps"
);
myMotor
->
step(
50
, FORWARD, MICROSTEP);
myMotor
->
step(
50
, BACKWARD, MICROSTEP);
}
84
Chapter 26. IoT-Bus Motor Example
Содержание IoT-Bus
Страница 1: ...iot bus Documentation Release latest oddWires Mar 05 2019...
Страница 2: ......
Страница 5: ...iot bus Documentation Release latest IoT Bus Introduction 1...
Страница 6: ...iot bus Documentation Release latest 2 IoT Bus Introduction...
Страница 16: ...iot bus Documentation Release latest 12 Chapter 1 IoT Bus Overview...
Страница 17: ...CHAPTER 2 IoT Bus Pinout 13...
Страница 18: ...iot bus Documentation Release latest Fig 1 IoT Bus Pinout 14 Chapter 2 IoT Bus Pinout...
Страница 22: ...iot bus Documentation Release latest 18 Chapter 4 Getting Started with PlatformIO...
Страница 24: ...iot bus Documentation Release latest 20 Chapter 5 Getting Started with Arduino...
Страница 26: ...iot bus Documentation Release latest 22 Chapter 6 Getting Started with esp idf...
Страница 32: ...iot bus Documentation Release latest 28 Chapter 7 Getting Started with Mozilla IoT...
Страница 34: ...iot bus Documentation Release latest 30 Chapter 8 Getting Started with Micro Python...
Страница 35: ...CHAPTER 9 Getting Started with Moddable You can find details on Getting Started with Moddable here 31...
Страница 36: ...iot bus Documentation Release latest 32 Chapter 9 Getting Started with Moddable...
Страница 38: ...iot bus Documentation Release latest 34 Chapter 10 Getting Started with MicroBlocks...
Страница 50: ...iot bus Documentation Release latest 46 Chapter 13 JTAG...
Страница 54: ...iot bus Documentation Release latest 50 Chapter 14 2 4 QVGA Touch Display...
Страница 66: ...iot bus Documentation Release latest 62 Chapter 19 IoT Bus Examples Index...
Страница 76: ...iot bus Documentation Release latest 72 Chapter 22 IoT Bus Touch Draw Example...
Страница 78: ...iot bus Documentation Release latest 74 Chapter 23 IoT Bus Relay Example...
Страница 94: ...iot bus Documentation Release latest 90 Chapter 27 IoT Bus SD_MMC Card Example...
Страница 98: ...iot bus Documentation Release latest 94 Chapter 28 IoT Bus Mozilla IoT Examples...
Страница 106: ...iot bus Documentation Release latest 102 Chapter 31 IoT Bus LED Lamp Thing...
Страница 114: ...iot bus Documentation Release latest 110 Chapter 33 IoT Bus Relay Display Touch Thing...
Страница 117: ...CHAPTER 35 IoT Bus DHT11 Thing include arduino h continues on next page 113...
Страница 122: ...iot bus Documentation Release latest 118 Chapter 35 IoT Bus DHT11 Thing...
Страница 123: ...CHAPTER 36 IoT Bus HC SR04 Thing Arduino framework include arduino h MOZ IoT continues on next page 119...
Страница 130: ...iot bus Documentation Release latest 126 Chapter 37 IoT Bus HC SR501 PIR Thing...
Страница 138: ...iot bus Documentation Release latest 134 Chapter 38 IoT Bus Calculator Thing...
Страница 140: ...iot bus Documentation Release latest 136 Chapter 39 IoT Bus Mozilla IoT Tutorials...
Страница 146: ...iot bus Documentation Release latest 142 Chapter 40 LED Thing Tutorial...
Страница 152: ...iot bus Documentation Release latest 148 Chapter 41 Touch Switch Thing Tutorial...
Страница 158: ...iot bus Documentation Release latest 154 Chapter 42 Mozilla Rules Engine...
Страница 160: ...iot bus Documentation Release latest 156 Chapter 43 Frameworks...
Страница 161: ...CHAPTER 44 Platforms 44 1 Espressif32 ESP WROOM32 WiFi Bluetooth Combo Module 157...