Datasheet

2. UIFlow
Wanna explore the easiest way of Servo programming??
Schematic
/*
If Button A was pressed,
stepmotor will rotate back and forth at a time
*/
#include <M5Stack.h>
#include <Wire.h>
#define STEPMOTOR_I2C_ADDR 0x70
// initialization
M5.begin();
Wire.begin();
// Controlling Protocol:
// G<n> X<distance>Y<distance>Z<distance> F<speed>
SendCommand(STEPMOTOR_I2C_ADDR, "G1 X20Y20Z20 F500");
SendCommand(STEPMOTOR_I2C_ADDR, "G1 X0Y0Z0 F400");
if (Wire.available() > 0) {
int u = Wire.read();
if (u != 0) Serial.write(u);
}
// Send Data to Module.
while (Serial.available() > 0) {
int inByte = Serial.read();
SendByte(STEPMOTOR_I2C_ADDR, inByte);
}
M5Stack Docs
// Get Data from Module.
Wire.requestFrom(STEPMOTOR_I2C_ADDR, 1);