This commit is contained in:
Lukas Bachschwell 2017-12-03 22:04:39 +01:00
parent 16d38c6435
commit 7efec87cee
4 changed files with 107 additions and 121 deletions

View File

@ -609,4 +609,3 @@ void Hippie::flapping(float steps, int T, int h, int dir){
//-- Let's oscillate the servos!
_execute(A, O, T, phase_diff, steps);
}

View File

@ -1,14 +1,8 @@
#ifndef Hippie_h
#define Hippie_h
#include <ESP32_Servo.h>
#include <Oscillator.h>
#include "Hippie_mouths.h"
#include "Hippie_sounds.h"
#include "Hippie_gestures.h"
//-- Constants
#define FORWARD 1
#define BACKWARD -1
@ -18,11 +12,6 @@
#define MEDIUM 15
#define BIG 30
#define PIN_Buzzer 10
#define PIN_Trigger 8
#define PIN_Echo 9
#define PIN_NoiseSensor A6
class Hippie
{
@ -62,10 +51,10 @@ class Hippie
void crusaito(float steps=1, int T=900, int h=20, int dir=FORWARD);
void flapping(float steps=1, int T=1000, int h=50, int dir=FORWARD);
void test_pos();
void test_pos();
void new_walk(int dir = FORWARD, float steps =4, int T=750);
void new_turn(int dir = LEFT, float steps =2, int T=1000);
void new_turn(int dir = LEFT, float steps =2, int T=1000);
private:
@ -89,5 +78,3 @@ class Hippie
};
#endif

View File

@ -5,14 +5,14 @@
//-- (c) Juan Gonzalez-Gomez (Obijuan), Dec 2011
//-- GPL license
//--------------------------------------------------------------
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#include <pins_arduino.h>
#endif
#include "Arduino.h"
#include "Oscillator.h"
#include <ESP32_Servo.h>
#if defined(ESP32)
#include <ESP32_Servo.h>
#else
#include <Servo.h>
#endif
//-- This function returns true if another sample
//-- should be taken (i.e. the TS time has passed since
@ -39,9 +39,6 @@ bool Oscillator::next_sample()
void Oscillator::attach(int pin, bool rev)
{
//-- If the oscillator is detached, attach it.
//Serial.println("PANIIIIIIIIIIIIIIIIIC");
// Serial.println(!_servo.attached());
//if(!_servo.attached()){
//-- Attach the servo and move it to the home position
_servo.attach(pin);
@ -64,7 +61,6 @@ void Oscillator::attach(int pin, bool rev)
//-- Reverse mode
_rev = rev;
//}
}

View File

@ -8,7 +8,11 @@
#ifndef Oscillator_h
#define Oscillator_h
#include <ESP32_Servo.h>
#if defined(ESP32)
#include <ESP32_Servo.h>
#else
#include <Servo.h>
#endif
//-- Macro for converting from degrees to radians
#ifndef DEG2RAD