Webotricks
Published © Apache-2.0

Otto DIY — Build Your Own Robot in One Hour!

Otto is an interactive robot that anyone can make!, Otto walks, dances, makes sounds and avoids obstacles.

BeginnerFull instructions provided1 hour108
Otto DIY — Build Your Own Robot in One Hour!

Things used in this project

Hardware components

Nano ATmega328
×1

Story

Read more

Schematics

otto image

Code

otto_by_bluetooth.ino

C/C++
#include <Otto.h>
#include <Otto_gestures.h>
#include <Otto_sounds.h>

// --- Otto servo pins ---
#define PIN_YL   2
#define PIN_YR   3
#define PIN_RL   4
#define PIN_RR   5
#define PIN_BUZZER 13

Otto Otto;

void setup() {
  Serial.begin(9600);  // Hardware Serial (pins 0 & 1)
  Otto.init(PIN_YL, PIN_YR, PIN_RL, PIN_RR, true, PIN_BUZZER);
  Otto.home();
  Otto.sing(S_connection);

  Serial.println("Otto Ready! Send F,B,L,R,J,D,S via Bluetooth.");
}

void loop() {
  if (Serial.available()) {
    char cmd = Serial.read();
    Serial.print("Command: ");
    Serial.println(cmd);

    switch (cmd) {
      case 'F': Otto.walk(4, 1000, 1); break;
      case 'B': Otto.walk(4, 1000, -1); break;
      case 'L': Otto.turn(3, 1000, -1); break;
      case 'R': Otto.turn(3, 1000, 1); break;
      case 'J': Otto.jump(1, 700); break;
      case 'D':
        Otto.moonwalker(3, 900, 20, 1);
        Otto.moonwalker(3, 900, 20, -1);
        Otto.sing(S_superHappy);
        break;
      case 'S': Otto.home(); break;
      default:  Serial.println("Unknown command"); break;
    }
  }
}

Credits

Webotricks
33 projects • 10 followers

Comments