Getting Started
Adafruit Playground is a wonderful and safe place to share your interests with Adafruit's vibrant community of makers and doers. Have a cool project you are working on? Have a bit of code that you think others will find useful? Want to show off your electronics workbench? You have come to the right place.
The goal of Adafruit Playground is to make it as simple as possible to share your work. On the Adafruit Playground users can create Notes. A note is a single-page space where you can document your topic using Adafruit's easy-to-use editor. Notes are like Guides on the Adafruit Learning System but guides are high-fidelity content curated and maintained by Adafuit. Notes are whatever you want them to be. Have fun and be kind.
Click here to learn more about Adafruit Playground and how to get started.
-
Nix Robot: Humanoid Gait
This robot is a bipedal robot for learning robotics that anyone can build. It is fun but complex enough to satisfy an engineering thought and effort. The system uses 8 LX-16A serial bus servos. I placed an Adafruit Metro board on it to run the C++ code. It can also work work on Raspberrry Pi.
The design of the machine is open and available on GrabCAD.
If you need to get all code and assembly guide, then code and the guide are in a book. The instructions are detailed so much that they show every screw and bolt in graphical drawings, explain all positioning precisely, and list Python and C++ code for all moves.
So how to build one? And how to program it? Follow these steps to achieve the result.
- Obtain the STL files, review them, make an assembly plan. Or read the book with the ready-to-use plan.
- Source necessary parts. Electronics BOM (bill of materials) could be found here.
- Prepare your workspace and tools or go to a makerspace.
- Construct the chassis.
- Understand the mechanics and program the gaits and other movements, or again get modifiable examples and classes form the book.
Below is an example of the source code for one gait.
-
LX-16A Library for Arduino
This is a library for servomotors: model names LX-16A and LX-224. I developed it with Adafruit Metro board and tested on ESP32 boards. The library is fully open-source and published here:
How does it work? It needs a bus linker (USB debug board) for these motors, and utilizes UART (RX and TX pins). Can it be used without the bus linker? Yes, but only to send commands, not to receive them.
The library provides a convenient class to control these servos.
For instance, to rotate to the given position/angle (for LX-16A from 0 to 240), call:
void move(float angle, uint16_t time = 0, bool wait = false);To read a physical angle at which the servo is currently positioned:
float getPhysicalAngle();The comprehensive set of methods allow to read temperature and voltage, set and get the mode of operation (motor or servo), set or get if torque is enabled, if an LED is enabled, change servo id, prepare a movement and execute it later.
Below is an example of the code to control the servo in a simple manner.
-
Step Motor Library for Raspberry Pi
This is a Python class for stepper motors: works with the current version of
gpiozero; works with 2-pin, 4-pin, 5-pin motors. The module is completely open-source and published here:How does it work? Place the
stepper.pyfile containing theStepperclass in your project directory (or, for the async version, theasync_stepper.pyfile withAsyncStepperclass). No need to install this library viapip. However,gpiozeroshall be already installed in your system.The library provides a class to control these motors.
For instance, to rotate the motor 1024 steps, call:
motor.step(1024)(where motor is your step motor object).There is a non-blocking version that could be started before a loop or in a loop:
motor.start(steps_to_move). Then each time in the loop call:step_motor.tick().Other methods set the speed, initialize the motor object, stop it. Async version can work in asynchronous programs.
Below is an example of the code to control a stepper motor in a simple manner.