Servo (use with mDesigner)

From Microduino Wiki
Jump to: navigation, search

The Servo is an actuator with precise position control. The angle of the arm (called the Servo Horn), can be controlled. Connectivity to an mCookie project is accomplished with the used of Hub Connector Cables and a Servo Connector. Support for this module is found in mDesigner.

Compatible Pins

A use of a Servo Connector and Hub Connector cables are required to connect a Servo to a project.
The following pins on the Hub or mCenter+'s Hub support this module:

Hub Digital Pins v2-01.png
Pin Name Compatibility Notes
Pin 0 Yes Not recommended, Pin 0 & 1 used by mDesigner (serial communication).
Pin 1 Yes Not recommended, Pin 0 & 1 used by mDesigner (serial communication).
Pin 2 Yes
Pin 3 Yes
Pin 4 Yes
Pin 5 Yes
Pin 6 Yes
Pin 7 Yes
Pin 8 Yes
Pin 9 Yes
Pin 10 Yes
Pin 11 Yes
Pin 12 Yes
Pin 13 Yes
Pin A0 Yes
Pin A1 Yes
Pin A2 Yes
Pin A3 Yes
Pin A6 Yes
Pin A7 Yes
Pin I2C No


Blocks

Servo - Set Angle

This block moves the Servo's horn to the configured angle. The Servo will attempt to move to the angle at the fastest speed.

Note: The angle is relative to where the Servo's horn has been place. Therefore, it is recommended to calibrate the angle first by setting the angle to 0, then placing the Servo horn.
MDesigner Servo Set Angle.png
  • Servo Number - the pin Servo is connected to.
  • Angle - the angle to set the Servo to.

Servo - Set Angle Duration

This block moves the Servo's horn from the starting angle to the ending angle over the duration time (milliseconds).

Note: The angle is relative to where the Servo's horn has been place. Therefore, it is recommended to calibrate the angle first by setting the angle to 0, then placing the Servo horn.
Note: If the Servo is not already at the starting angle, then the Servo will quickly move to the starting angle. It is recommended to have the Servo's angle at the starting angle before encountering this block.
Note: This block is holding. Which means the angle change must complete (the entire duration) before the program goes to the next block in the script.
MDesigner Servo Set Angle Duration.png
  • Servo Number - the pin Servo is connected to.
  • Start Angle - the angle to start from.
  • End Angle - the angle to end at.
  • Duration - the amount of time (in milliseconds) the Servo needs to take moving from the starting angle to the ending angle.