No description
Find a file
2026-06-17 09:12:06 +02:00
buzzer first commit 2026-05-19 09:24:30 +02:00
examples missing filesº 2026-06-17 09:03:51 +02:00
gotto-bot added calibration, remote 2026-06-13 07:53:09 +02:00
ninja added calibration, remote 2026-06-13 07:53:09 +02:00
remote first commit 2026-05-19 09:24:30 +02:00
servo first commit 2026-05-19 09:24:30 +02:00
tutorials missing filesº 2026-06-17 09:03:51 +02:00
.gitignore Initial commit 2026-04-14 16:36:08 +00:00
go.mod first commit 2026-05-19 09:24:30 +02:00
go.sum first commit 2026-05-19 09:24:30 +02:00
LICENSE Initial commit 2026-04-14 16:36:08 +00:00
README.md fix 2026-06-17 09:12:06 +02:00

gotto

Early-stage project. Gotto is under active development. APIs, examples, and documentation will change as the robot evolves. Expect rough edges.

Gotto is a small bipedal robot written in TinyGo for the nRF52840 microcontroller. It can walk in a bipedal gait or switch to a rolling mode where it glides on its feet like a scooter. The project includes a BLE remote control layer so it can be driven from an Android app, a PC, or a second nRF52840 board (NiceBadge).


⚠️ Calibration is mandatory

Every physical robot is different. Servo motors vary between units, and small differences in how the robot is assembled change the angles and speeds that produce correct movement. Running the calibration example before anything else is not optional — skipping it will result in jerky motion, incorrect posture, or servos straining against mechanical limits.

The calibration example walks you through:

  • Finding the deadband of each continuous foot servo (the speed range where the motor does not actually move), computing the neutral offset, and determining a safe walking speed.
  • Scanning the physical range of each positional leg servo so the robot never commands an angle that the mechanics cannot reach.
  • Adjusting the Trim values that compensate for differences in servo mounting and individual servo tolerances.

The calibration output — servo constructor arguments and a ninja.Trim{} struct — must be pasted into every other program you flash. Keep those numbers; they are specific to your unit.

See tutorials/01-basics.md for a full walkthrough of the calibration process.


Project structure

gotto/
├── ninja/          High-level robot control (Walk, Roll, Wave, Tilt, Spin…)
├── servo/          Thin wrappers around TinyGo servo drivers
│                   New180 (positional 0180°) and New360 (continuous -100..+100)
├── remote/         BLE remote control protocol — Command, Op codes, Execute()
├── buzzer/         Buzzer tone helper (not yet wired on all builds)
├── examples/
│   ├── calibration/        ← Start here. Unified calibration for all four servos.
│   ├── foot_calibration/   Standalone foot-servo deadband scan
│   ├── leg_calibration/    Standalone leg-servo range scan
│   ├── trim/               Interactive trim fine-tuning after calibration
│   ├── demo/               Basic movement sequence (Walk + Roll + Wave)
│   ├── remote/             BLE peripheral — drive the robot from a phone or PC
│   ├── servotest/          Raw servo test, useful for hardware debugging
│   └── obstacle_avoidance/ Ultrasonic sensor integration (optional hardware)
└── tutorials/
    ├── 01-basics.md        Servos, calibration, ninja API, Walk and Roll modes
    └── 02-remote.md        BLE architecture, Microblue app, Python, NiceBadge

Key packages

ninja — the main abstraction. Takes four calibrated servo objects and exposes robot-level operations. Internally handles smooth angle transitions, mode switching, and trim application. Two modes:

  • ModeWalk — bipedal gait. Legs at 90°, feet spin to push.
  • ModeRoll — scooter mode. Legs raised, feet drive like wheels.

servo — wraps tinygo.org/x/drivers/servo with microsecond calibration bounds. New180 for leg servos, New360 for foot servos. The usLow/usHigh parameters come from the calibration output.

remote — defines Command{Op, Args} and an Execute(*ninja.Ninja) method. The companion file examples/remote/microblue_remote.go implements a BLE peripheral using the Nordic UART Service so any NUS-compatible app can drive the robot.


Quick start

1. Prerequisites

  • TinyGo installed
  • nRF52840 board connected via USB

2. Calibrate first

tinygo flash -target=xiao-ble ./examples/calibration/
tinygo monitor

Follow the prompts in the serial monitor. At the end, copy the printed values into the next program you flash.

3. Run the demo

Paste your calibration output into examples/demo/demo.go, then:

tinygo flash -target=xiao-ble ./examples/demo/

4. Add remote control

Paste calibration values into examples/remote/remote.go and flash it. Connect from the Microblue Android app, from a Python script using Bleak, or from a NiceBadge board.

See tutorials/02-remote.md for full instructions.


Hardware

Component Details
MCU nRF52840 (e.g. Seeed XIAO BLE)
Leg servos (×2) Standard 180° positional — pins P0_22 (L), P0_24 (R)
Foot servos (×2) 360° continuous — pins P0_17 (L), P0_20 (R)
PWM channels PWM0PWM3 (one per servo)

License

See LICENSE.