Hello, so as a student me and my team are working on this school project call the dancing tito, it is a small 3D printed robot that is suppose to dance and move to the code that was given, however, the code that as provided had some errors that we're trying to figure out. It seems like the very last line of code is always an error no matter what we type to correct it.
At first it was the library, but one we have downloaded that and upload it, it seems like the code still refuse to work. Can we get some assistance on this project?
Website Link to Project: https://wikifactory.com/+OttoDIY/tito
Written Code:
#include <Adafruit_CircuitPlayground.h>
#include <Adafruit_Circuit_Playground.h>
#include <Servo.h>
#include <Oscillator.h>
#include <Otto.h>
Otto.h Otto; // This is Otto!
byte leftLeg = 2;
byte rightLeg = 3;
byte leftFoot = 4;
byte rightFoot= 5;
byte buzzer = 12;
byte trigPin = 8;
byte echoPin = 9;
// Variables for dancing routine
bool obstacleDetected = false;
int distance = 0;
// forward declarations
void danceParty();
void setup() {
// put your setup code here, to run once:
Otto.init(leftLeg, rightLegt, leftFoot, rightFoot, false, 0, buzzer, trigPin, echoPin);
Otto.home(); // reset servo positions
delay(50);
}
void loop() {
// put your main code here, to run repeatedly:
distance = Otto.getDistance();
if(distance < 200); {
danceParty();
} else {
}
}
void danceParty(){
Otto.walk(3, 1000, 1); // walk 3 steps
delay(300);
Otto.home();
Otto.playGesture(OttoHappy); // be happy
delay(50);
Otto.turn(2, 800, 1); // turn left
delay(50);
Otto.moonwalker(3, 800, 25, 1); // moonwalk it out!
Otto.home();
Otto.playGesture(OttoLove); // bow chikka wowow
delay(50);
Otto.turn(2, 800, -1); // turn right
delay(50);
Otto.jump(1,2000); // J U M P
Otto.home();
}
Library Links: Otto DIY · GitHub