changed basic example

This commit is contained in:
Lukas Bachschwell 2017-12-11 23:41:21 +01:00
parent a20c5ad65a
commit 651025f826

View File

@ -1,4 +1,4 @@
// This examples shows the Hippie Library used toghether with ESPUI Library by Lukas Bachschwelll on the ESP32 // This examples shows the basic moves of the Hippie Library
#include <Hippie.h> #include <Hippie.h>
#include <Oscillator.h> #include <Oscillator.h>
@ -6,22 +6,6 @@ const char* ssid = "Hippie";
Hippie hippie; Hippie hippie;
boolean walk_forward = false;
boolean walk_backward = false;
boolean jump = false;
boolean turn_left = false;
boolean turn_right = false;
boolean shake = false;
boolean swing = false;
boolean tt_swing = false;
boolean jitter = false;
boolean bend = false;
boolean flap = false;
boolean moon = false;
boolean moon_r = false;
boolean cruise = false;
boolean test_pos = false;
void setup() void setup()
{ {
Serial.begin(115200); Serial.begin(115200);
@ -39,20 +23,54 @@ void setup()
void loop() void loop()
{ {
if (walk_forward) hippie.new_walk(); hippie.new_walk();
else if (walk_backward) hippie.new_walk(2, 4, 750); hippie.home();
else if (turn_left) hippie.new_turn(); delay(500);
else if (turn_right) hippie.new_turn(2);
else if (shake) hippie.shakeLeg(); // backward, shit piece
else if (jump) hippie.jump(); hippie.new_walk(2, 4, 750);
else if (swing) hippie.swing(); hippie.home();
else if (tt_swing) hippie.tiptoeSwing(); delay(500);
else if (jitter) hippie.jitter();
else if (bend) hippie.bend(); // left
else if (flap) hippie.flapping(); hippie.new_turn();
else if (moon) hippie.moonwalker(); hippie.home();
else if (moon_r) hippie.moonwalker(1, 900, 50, -1); delay(500);
else if (cruise) hippie.crusaito();
else if (test_pos) hippie.test_pos(); // right
else hippie.home(); hippie.new_turn(2);
hippie.home();
delay(500);
hippie.shakeLeg(); // TODO: Specify which leg
hippie.home();
delay(500);
// left moonwalk
hippie.moonwalker();
hippie.home();
delay(500);
// right moonwalk
hippie.moonwalker(1, 900, 50, -1);
hippie.home();
delay(500);
// jump (it is not really a jump)
hippie.jump();
hippie.home();
delay(500);
/*
// Here is some more to experiment with
hippie.swing();
hippie.tiptoeSwing();
hippie.jitter();
hippie.bend();
hippie.flapping();
hippie.crusaito();
hippie.test_pos();
*/
} }