Servo for micro:bit

Monk Makes  |  SKU: 3406
£9.53
Tax included, shipping and discounts calculated at checkout.


DESCRIPTION

The MonkMakes Servo for micro:bit board provides a really easy way to attach up to three servomotors to a BBC micro:bit. The board requires a power supply or battery pack to provide 5 or 6V to the servomotors. It includes a voltage regulator that will supply 3V back to the micro:bit, so that you don’t have to power it separately.

FEATURES
  • Header pins for three servo motors
  • Up to 2A total can be supplied to the servo motors
  • Regulated 3V output to power your micro:bit
  • Polarity protection for the servomotors
  • Electrolytic reservoir capacitor for the servomotors
  • 1kΩ series resistors to the control signals to prevent accidental short-circuits of the micro:bit’s output pins.
  • Orange LED to indicate that the Servo for micro:bit board has power.
RESOURCES

Block Programming Example

To check that everything is working, this Blocks code project will get you started. Flash it onto your Servo for micro:bit and the servo arms should all start wiggling in a random manner.

Servo for micro:bit

The servo write pin block allows you to set the angle of the servomotor’s arm between 0 and 180 degrees. Note that servomotors, will not usually travel a full 180 degrees so you may find the actual range is more like 10 to 170 degrees.

MicroPython Example

The following MicroPython example will move the servo one way or another when you press the A and B buttons.

from microbit import *
def set_servo_angle(pin, angle):
   duty = 26 + (angle * 102) / 180
   pin.write_analog(duty)
angle = 90
set_servo_angle(pin2, angle)
while True:
   if button_a.was_pressed() and angle >= 10:
      angle -= 10
      set_servo_angle(pin2, angle)
   if button_b.was_pressed() and angle <= 170:
      angle += 10
      set_servo_angle(pin2, angle)
Servo for micro:bit - Micro:bit
Monk Makes

Servo for micro:bit

£9.53
DESCRIPTION

The MonkMakes Servo for micro:bit board provides a really easy way to attach up to three servomotors to a BBC micro:bit. The board requires a power supply or battery pack to provide 5 or 6V to the servomotors. It includes a voltage regulator that will supply 3V back to the micro:bit, so that you don’t have to power it separately.

FEATURES
RESOURCES

Block Programming Example

To check that everything is working, this Blocks code project will get you started. Flash it onto your Servo for micro:bit and the servo arms should all start wiggling in a random manner.

Servo for micro:bit

The servo write pin block allows you to set the angle of the servomotor’s arm between 0 and 180 degrees. Note that servomotors, will not usually travel a full 180 degrees so you may find the actual range is more like 10 to 170 degrees.

MicroPython Example

The following MicroPython example will move the servo one way or another when you press the A and B buttons.

from microbit import *
def set_servo_angle(pin, angle):
   duty = 26 + (angle * 102) / 180
   pin.write_analog(duty)
angle = 90
set_servo_angle(pin2, angle)
while True:
   if button_a.was_pressed() and angle >= 10:
      angle -= 10
      set_servo_angle(pin2, angle)
   if button_b.was_pressed() and angle <= 170:
      angle += 10
      set_servo_angle(pin2, angle)
View product