Overview
Who doesn't love LEGO-compatible bricks? Nobody! Except when we accidentally step on them. There are soooo many mechanical things one can make with those ubiquitous bricks, plates, gears, and pulleys.
But what do you do when you want to add LEGO-compatible bricks and parts to your robotics project? Instead of hot glue, epoxy and hope, you can use a nicely designed resin-printed mounting shape.
Horizontal and Vertical Micro Servo Mounts for LEGO-Compatible Brick Systems fit Adafruit '9g' Micro Servos and Micro-Servo-sized DC motors securely with lots of dots on the bottom so you can mechanize your build easily.
Just place your micro servo, secure it with a screw (included with the servo), and it's ready to adapt to the standard LEGO-compatible parts. The servo and servo driving hardware is not included, this is just the plastic piece!
A PropMaker Feather powers the continuous servo making it really easy to plug and play with the built in header, just plug the servo right in!
The Terminal connector makes it easy to attach a NeoPixel strip to add lights to any scene.
A mini slide switch allows us to easily power our builds on and off so we designed a little holder that also has LEGO compatible studs.
Page last edited October 01, 2024
Text editor powered by tinymce.
3D Printing Your Own
You can buy the servo mounts from Adafruit, horizontal and vertical.
Other parts will be added to the Adafruit store in the future.
If you are keen to print your own with a 3D printer, the files are available from the links below.
3D Printed Parts
STL files for 3D printing will need to be oriented for print using either FDM or SLS machines. Parts were tested using PLA filament. Use super glue to adhere the top and bottom halves together.
Original design source files may be downloaded using the links below
Page last edited October 01, 2024
Text editor powered by tinymce.
Assembly
Servos
Just use the mounting screws included with the servo to secure the micro servo to either of the 3D printed mounts.
Feather
The Feather LEGO-compatible mount features a low-profile plate for fitting into tight spaces and allowing wire to run underneath. It's got a series of tubes on the bottom and four built-in stand-offs for securing the board with machine screws.
Use M2.5x6mm screws for the screws near the USB port.
The screws holes near the terminal block require M2x6mm screws.
Slide Switch
A mini slide switch allows one to easily turn the power for builds on and off. To facilitate their use, we designed a little holder that also has LEGO compatible studs.
Move the slide switch toggle to the middle and insert the body at an angle to press fit into place.
Page last edited October 01, 2024
Text editor powered by tinymce.
Circuit Diagram
The diagram below provides a general visual reference for wiring of the components once you get to the Assembly page. This diagram was created using the software package Fritzing.
Adafruit Library for Fritzing
Adafruit uses the Adafruit's Fritzing parts library to create circuit diagrams for projects. You can download the library or just grab individual parts. Get the library and parts from GitHub - Adafruit Fritzing Parts.
Wired Connections
- The speaker is connected to the pins on the screw block terminal
- The NeoPixel Strip is connected to the pins on the screw block terminal
- The servo plugs into the servo connection pins
- The slide switch is connected to the EN and GND pins on the Feather
- The USB battery plugs into the USB C port on the Feather
DC Motor in Micro Servo Body
Skip the micro controller and use a AAA or AA battery pack with an on and off switch.
Use two Plug to Plug jumper wires to connect the JST port on a battery pack to the DC servo, so no microcontroller is required at all!
Page last edited October 01, 2024
Text editor powered by tinymce.
CircuitPython
CircuitPython is a derivative of MicroPython designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the CIRCUITPY drive to iterate.
CircuitPython Quickstart
Follow this step-by-step to quickly get CircuitPython running on your board.
Click the link above to download the latest CircuitPython UF2 file.
Save it wherever is convenient for you.
To enter the bootloader, hold down the BOOT/BOOTSEL button (highlighted in red above), and while continuing to hold it (don't let go!), press and release the reset button (highlighted in red or blue above). Continue to hold the BOOT/BOOTSEL button until the RPI-RP2 drive appears!
If the drive does not appear, release all the buttons, and then repeat the process above.
You can also start with your board unplugged from USB, press and hold the BOOTSEL button (highlighted in red above), continue to hold it while plugging it into USB, and wait for the drive to appear before releasing the button.
A lot of people end up using charge-only USB cables and it is very frustrating! Make sure you have a USB cable you know is good for data sync.
You will see a new disk drive appear called RPI-RP2.
Drag the adafruit_circuitpython_etc.uf2 file to RPI-RP2.
The RPI-RP2 drive will disappear and a new disk drive called CIRCUITPY will appear.
That's it, you're done! :)
Safe Mode
You want to edit your code.py or modify the files on your CIRCUITPY drive, but find that you can't. Perhaps your board has gotten into a state where CIRCUITPY is read-only. You may have turned off the CIRCUITPY drive altogether. Whatever the reason, safe mode can help.
Safe mode in CircuitPython does not run any user code on startup, and disables auto-reload. This means a few things. First, safe mode bypasses any code in boot.py (where you can set CIRCUITPY read-only or turn it off completely). Second, it does not run the code in code.py. And finally, it does not automatically soft-reload when data is written to the CIRCUITPY drive.
Therefore, whatever you may have done to put your board in a non-interactive state, safe mode gives you the opportunity to correct it without losing all of the data on the CIRCUITPY drive.
To enter safe mode when using CircuitPython, plug in your board or hit reset (highlighted in red above). Immediately after the board starts up or resets, it waits 1000ms. On some boards, the onboard status LED (highlighted in green above) will blink yellow during that time. If you press reset during that 1000ms, the board will start up in safe mode. It can be difficult to react to the yellow LED, so you may want to think of it simply as a slow double click of the reset button. (Remember, a fast double click of reset enters the bootloader.)
In Safe Mode
If you successfully enter safe mode on CircuitPython, the LED will intermittently blink yellow three times.
If you connect to the serial console, you'll find the following message.
Auto-reload is off. Running in safe mode! Not running saved code. CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode. Press any key to enter the REPL. Use CTRL-D to reload.
You can now edit the contents of the CIRCUITPY drive. Remember, your code will not run until you press the reset button, or unplug and plug in your board, to get out of safe mode.
Flash Resetting UF2
If your board ever gets into a really weird state and CIRCUITPY doesn't show up as a disk drive after installing CircuitPython, try loading this 'nuke' UF2 to RPI-RP2. which will do a 'deep clean' on your Flash Memory. You will lose all the files on the board, but at least you'll be able to revive it! After loading this UF2, follow the steps above to re-install CircuitPython.
Page last edited October 01, 2024
Text editor powered by tinymce.
Prop-Maker Example
Carousel Code
The Following example is used in the Carousel demo to continuously spin the servo with a NeoPixel rainbow fade while playing an audio loop.
# SPDX-FileCopyrightText: 2024 Noe Ruiz for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import board
import audiocore
import audiobusio
import audiomixer
from digitalio import DigitalInOut, Direction
import pwmio
import neopixel
from adafruit_led_animation.animation.rainbow import Rainbow
from adafruit_motor import servo
# enable external power pin
# provides power to the external components
external_power = DigitalInOut(board.EXTERNAL_POWER)
external_power.direction = Direction.OUTPUT
external_power.value = True
# i2s playback
wave_file = open("carousel-loop.wav", "rb")
wave = audiocore.WaveFile(wave_file)
audio = audiobusio.I2SOut(board.I2S_BIT_CLOCK, board.I2S_WORD_SELECT, board.I2S_DATA)
mixer = audiomixer.Mixer(voice_count=1, sample_rate=22050, channel_count=1,
bits_per_sample=16, samples_signed=True)
audio.play(mixer)
mixer.voice[0].play(wave, loop=True)
# servo control
pwm = pwmio.PWMOut(board.EXTERNAL_SERVO, frequency=5)
prop_servo = servo.ContinuousServo(pwm)
# external neopixels
num_pixels = 43
pixels = neopixel.NeoPixel(board.EXTERNAL_NEOPIXELS, num_pixels)
pixels.brightness = 0.3
rainbow = Rainbow(pixels, speed=0.05, period=2)
while True:
prop_servo.throttle = 1
rainbow.animate()
mixer.voice[0].level = 1
Your RP2040 Prop-Maker Feather CIRCUITPY drive should look like this after copying the lib folder, the code.py file and wand-mix-sfx.wav audio file
Page last edited October 01, 2024
Text editor powered by tinymce.