Rapid development framework for Otto DIY robots. Expressive facades over hardware-truth modules, zero-config kit presets, and full low-level access -- nothing hidden.
#include <OttoFlow.h>
void setup() {
OttoFlow::start(); // classic Otto kit: zero config
Mouth::show(Icon::Heart);
}
void loop() {
if (Eyes::closerThanCm(15)) {
Mouth::show(Icon::Surprised);
Legs::walkBackward(2);
} else {
Mouth::show(Icon::Happy);
Legs::walkForward(1);
}
}That's a complete obstacle-avoiding robot. No pin maps, no libraries to wire up, no magic numbers.
| Task | Raw OttoDIYLib | OttoFlow |
|---|---|---|
| First sketch | pin defines + init boilerplate | OttoFlow::start(); |
| Show a heart | putMouth(13) or putMouth(heart) |
Mouth::show(Icon::Heart) |
| Read distance | write your own pulseIn code |
Eyes::distanceCm() (median-filtered) |
| Walk | walk(2, 1000, 1) -- what's 1? |
Legs::walkForward(2) |
| Test hardware safely | comment out code, reflash | Motion::disable() + serial console |
| Advanced access | -- | full module layer + OttoFlow::driver() |
Facades Mouth::show(Icon::Heart) <- expressive, beginner-friendly
Modules Matrix::drawPixel(3, 4, true) <- hardware-truth names, full control
Driver OttoFlow::driver().oscillateServos(...) <- raw OttoDIYLib, official escape hatch
Start at the top. Drop down whenever you need more. No locked doors.
[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328
framework = arduino
lib_deps = https://github.com/ahmeddabak/OttoFlow.git#include <OttoFlow.h>
void setup() { OttoFlow::start(); Mouth::show(Icon::Heart); }
void loop() {}OttoFlow::start(); // classic biped kit (default wiring)
OttoFlow::start(Preset::Humanoid); // biped + arms on pins 6/7
OttoConfig cfg = Preset::Humanoid; // power user: override anything
cfg.arms.leftPin = 10;
cfg.matrix.brightness = 8;
cfg.ultrasonic.samples = 5;
OttoFlow::start(cfg);Default wiring (classic kit): legs 2/3, feet 4/5, buzzer 13, ultrasonic 8/9, matrix DIN A3 / CS A2 / CLK A1.
Test every part of the robot from the Serial Monitor -- no reflashing:
void setup() { OttoFlow::start(); Console::begin(9600); }
void loop() { Console::poll(); }> dist
23 cm
> mouth heart
> legs on
> center
> arms up
> watch mic
help lists every command.
Building feature by feature? Keep the robot still and silent while you verify sensors:
Motion::disable(); // ALL servos detached (legs + arms): no movement, no jitter
Voice::mute(); // no sounds(Legs::disable() / Arms::relax() switch off just one servo group.)
Mouth--show(Icon::...),showDigit(7),scrollText("HI"),setBrightness(8),clear()Eyes--distanceCm(),closerThanCm(15),fartherThanCm(50)Voice--play(Sound::Happy),playToneHz(440, 200),playHappyBirthday(),mute()/unmute()Legs--walkForward(2),turnLeft(3),moonwalkLeft(),center(),enable()/disable(), trimsMotion--disable()/enable()-- ALL servos (legs + arms) in one callArms--center(),up(),down(),raiseBoth(),waveRight(),relax()(humanoid builds)Gestures--play(Gesture::Victory)-- movement + mouth + sound in one callTouch--isTouched(),wasTapped()(debounced, works with toggle-mode sensors)Ears--loudnessPercent(),hearsSoundLouderThanPercent(60)(microphone)LightSensor--brightnessPercent(),isDarkerThanPercent(20)(photoresistor)Balance--pitchDegrees(),isUpsideDown(),isShakenHarderThanG(0.6)(MPU-6050)AppLink-- control Otto from the official Otto DIY phone app over Bluetooth- Modules --
Matrix,Ultrasonic,Buzzer,Melody,LegServos,ArmServos,TouchSensor,SoundSensor,LightSensor,Bluetooth,Mpu6050for full control - Driver --
#include <OttoFlowDriver.h>->OttoFlow::driver()is the raw OttoDIYLib object
Every name states its meaning and unit: distanceCm(), not dist(); walkForward(2), not walk(2,1000,1).
home() is an alias for center() on both Legs and Arms. Both-arm calls mirror the
right servo (up() is left 180 / right 0), because the two arm servos face opposite ways.
The wiki is the full manual -- a page per part of the robot, plus configuration, calibration, and troubleshooting:
- Installation and Configuration -- presets, pins, every setting
- Examples -- complete, ready-to-flash sketches
- Mouth, Voice, Movement, Arms, Gestures, Motion
- Eyes, Ears, Touch, Light, Balance
- Bench Testing, Serial Console, Calibration
- API Reference -- every public function on one page
The library ships no examples/ folder -- the wiki's Examples page carries the
sketches instead, ready to paste.
- DESIGN.md -- architecture and the reasoning behind every API decision
- ROADMAP.md -- what's planned next (non-blocking engine, events, ...)
GPL-3.0 -- required and proudly inherited from OttoDIYLib, which OttoFlow wraps as its driver layer. Support Otto DIY by purchasing kits at ottodiy.com.