Cleanup
This commit is contained in:
parent
16d38c6435
commit
7efec87cee
@ -609,4 +609,3 @@ void Hippie::flapping(float steps, int T, int h, int dir){
|
|||||||
//-- Let's oscillate the servos!
|
//-- Let's oscillate the servos!
|
||||||
_execute(A, O, T, phase_diff, steps);
|
_execute(A, O, T, phase_diff, steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
Hippie.h
13
Hippie.h
@ -1,14 +1,8 @@
|
|||||||
#ifndef Hippie_h
|
#ifndef Hippie_h
|
||||||
#define Hippie_h
|
#define Hippie_h
|
||||||
|
|
||||||
#include <ESP32_Servo.h>
|
|
||||||
#include <Oscillator.h>
|
#include <Oscillator.h>
|
||||||
|
|
||||||
#include "Hippie_mouths.h"
|
|
||||||
#include "Hippie_sounds.h"
|
|
||||||
#include "Hippie_gestures.h"
|
|
||||||
|
|
||||||
|
|
||||||
//-- Constants
|
//-- Constants
|
||||||
#define FORWARD 1
|
#define FORWARD 1
|
||||||
#define BACKWARD -1
|
#define BACKWARD -1
|
||||||
@ -18,11 +12,6 @@
|
|||||||
#define MEDIUM 15
|
#define MEDIUM 15
|
||||||
#define BIG 30
|
#define BIG 30
|
||||||
|
|
||||||
#define PIN_Buzzer 10
|
|
||||||
#define PIN_Trigger 8
|
|
||||||
#define PIN_Echo 9
|
|
||||||
#define PIN_NoiseSensor A6
|
|
||||||
|
|
||||||
|
|
||||||
class Hippie
|
class Hippie
|
||||||
{
|
{
|
||||||
@ -89,5 +78,3 @@ class Hippie
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,14 +5,14 @@
|
|||||||
//-- (c) Juan Gonzalez-Gomez (Obijuan), Dec 2011
|
//-- (c) Juan Gonzalez-Gomez (Obijuan), Dec 2011
|
||||||
//-- GPL license
|
//-- GPL license
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
#if defined(ARDUINO) && ARDUINO >= 100
|
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#else
|
|
||||||
#include "WProgram.h"
|
|
||||||
#include <pins_arduino.h>
|
|
||||||
#endif
|
|
||||||
#include "Oscillator.h"
|
#include "Oscillator.h"
|
||||||
|
#if defined(ESP32)
|
||||||
#include <ESP32_Servo.h>
|
#include <ESP32_Servo.h>
|
||||||
|
#else
|
||||||
|
#include <Servo.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//-- This function returns true if another sample
|
//-- This function returns true if another sample
|
||||||
//-- should be taken (i.e. the TS time has passed since
|
//-- 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)
|
void Oscillator::attach(int pin, bool rev)
|
||||||
{
|
{
|
||||||
//-- If the oscillator is detached, attach it.
|
//-- 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
|
//-- Attach the servo and move it to the home position
|
||||||
_servo.attach(pin);
|
_servo.attach(pin);
|
||||||
@ -64,7 +61,6 @@ void Oscillator::attach(int pin, bool rev)
|
|||||||
|
|
||||||
//-- Reverse mode
|
//-- Reverse mode
|
||||||
_rev = rev;
|
_rev = rev;
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,11 @@
|
|||||||
#ifndef Oscillator_h
|
#ifndef Oscillator_h
|
||||||
#define Oscillator_h
|
#define Oscillator_h
|
||||||
|
|
||||||
|
#if defined(ESP32)
|
||||||
#include <ESP32_Servo.h>
|
#include <ESP32_Servo.h>
|
||||||
|
#else
|
||||||
|
#include <Servo.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//-- Macro for converting from degrees to radians
|
//-- Macro for converting from degrees to radians
|
||||||
#ifndef DEG2RAD
|
#ifndef DEG2RAD
|
||||||
|
Loading…
Reference in New Issue
Block a user