Class ServoStepperPositionI2C - GSTCH/SketchMadeEASY GitHub Wiki
Topic | Specification |
---|---|
Description | This class controls a position drive. It controls a stepper motor using Adafruit Motor Shield Version 2. This is able to control up to 2 stepper motors. It’s connected via I2C Bus. Up to 32 are stackable. Sketch Made EASY includes an auto map from input to actuator. The class map the range of the assigned input (via relation) to an angle. |
Constructor |
ServoStepperPositionI2C(int StepperNr, int Resolution, int GearRatio, int MinAngle, int MaxAngle, int RotationSpeed = 50, EInitializeMode InitializeMode = spNone, int HomeSwitchPin = 0, ESwitchResistoreMode HomeSwitchResistoreMode = smPullDownInternal, EStepStyle aStepStyle = ssSingle, int aBusAdddress = 0x60) Parameter StepperNr: stepper motor 1 or 2 of the shieldResolution: Steps per revolution of the stepper motor (without gear)GearRatio: Gear box ratioMinAngle: Minimum angle of the servoMaxAngle: Maximum angle of the servoRotationSpeed: Speed of the motor [rotations per minute]. Optionally with value 50.InitializeMode: With a limit switch the stepper is able to start from a defined position. Optionally with value spNone. Multiple modes are possible:HomeSwitchPin: Digital pin with limit switch to detect 0-position. Optionally with the value 0SwitchResistoreMode: Optional with default smPullDownInternal. Details read Switch-Resistore-Mode. Possible values are:StepStyle: Type of stepper motor signal. Optionally with the value ssSingle. Possible values are:BusAdddress: I2C Address of the shield. Optionally with the value 0x60. If several shields are stacked, the address must be changed (by soldering). If several shields are stacked, the address must be changed (by soldering). |
Range | MinAngle…MaxAngle |
Samples | ServoStepperPositionI2C* stepper = new ServoStepperPositionI2C(2, 20, 71, -180, 180, 20); |
Examples | 18 ‐ Stepper angle controlled by joystick |