-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
- Requirements
- PlatformIO
- Arduino IDE
- Your first sketch
- Uploading and the serial monitor
- What
start()actually does
| Board | Arduino Nano or Uno (ATmega328) |
| Framework | Arduino |
| Dependencies | OttoDIYLib, Servo 1.2.0 or newer |
| Robot | Otto DIY biped, or the Humanoid build with arms |
Both dependencies are declared by OttoFlow, so your package manager installs them for you.
Add OttoFlow to the lib_deps of your environment. OttoFlow is not in the PlatformIO registry, so point at the git repository:
[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328
framework = arduino
lib_deps = https://github.com/ahmeddabak/OttoFlow.gitpio run pulls OttoFlow, OttoDIYLib, and Servo on the next build.
Note Many Nano clones ship the old bootloader. If uploading times out, switch the environment to
board = nanoatmega328withboard_upload.speed = 57600, or pick the "ATmega328P (Old Bootloader)" processor in the Arduino IDE.
If you prefer the library inside your repository -- handy while you are changing OttoFlow itself -- drop it in lib/OttoFlow/ and declare only the two dependencies:
[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328
framework = arduino
lib_deps =
https://github.com/OttoDIY/OttoDIYLib.git
arduino-libraries/ServoPlatformIO picks up anything under lib/ automatically.
- Download the repository as a ZIP from GitHub.
- Sketch > Include Library > Add .ZIP Library and select the file.
- Install OttoDIYLib the same way, and Servo from Tools > Manage Libraries.
- Select Tools > Board > Arduino Nano and the correct port.
#include <OttoFlow.h>
void setup() {
OttoFlow::start();
Mouth::show(Icon::Heart);
}
void loop() {
}One include is all a sketch ever needs. <OttoFlow.h> brings in every facade, every module, the icon and sound catalogs, and the serial console.
Note The console costs nothing unless you call
Console::begin(). The linker strips unused code, so including everything does not inflate your binary.
pio run -t upload
pio device monitor -b 9600
If buzzer.helloOnStart is left at its default, Otto chirps once when start() finishes -- your proof that the firmware booted.
OttoFlow::start() performs the whole bring-up in one call:
- Attaches the four leg and foot servos and the buzzer pin, loading saved trims from EEPROM when
loadTrimsFromEepromis enabled. - Initialises the LED matrix and applies the configured brightness.
- Sets the ultrasonic trigger and echo pin modes.
- Sets the touch sensor pin mode.
- Attaches the arm servos, if this build has arms enabled.
- Starts Bluetooth and the MPU-6050, if enabled.
- Plays the hello chirp, unless the buzzer is muted.
Call it once, at the top of setup(), before any other OttoFlow call. Next: Configuration.
OttoFlow is licensed under GPL-3.0 and wraps OttoDIYLib. Buy the kits at ottodiy.com.
Prologue
Getting Started
The Basics
Digging Deeper
- Bench Testing
- Serial Console
- Calibration
- Bluetooth and the Otto App
- Modules
- The Driver
- Extending OttoFlow
Reference