2017-11-20 16:49:55 +00:00
|
|
|
#ifndef SimpleExpressions_h
|
|
|
|
#define SimpleExpressions_h
|
2017-11-20 13:59:19 +00:00
|
|
|
#include <Adafruit_NeoPixel.h>
|
|
|
|
#ifdef __AVR__
|
|
|
|
#include <avr/power.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Shapes.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-20 16:49:55 +00:00
|
|
|
class SimpleExpressionsClass
|
2017-11-20 13:59:19 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
void init(int mouthPin, int buzzerPin);
|
|
|
|
|
2017-11-20 16:49:55 +00:00
|
|
|
void writeMouth();
|
2017-11-20 13:59:19 +00:00
|
|
|
void putMouth(unsigned long int mouth, bool predefined = true);
|
|
|
|
void putAnimationMouth(unsigned long int anim, int index);
|
|
|
|
void clearMouth();
|
|
|
|
|
|
|
|
//-- Sounds
|
|
|
|
void _tone (float noteFrequency, long noteDuration, int silentDuration);
|
|
|
|
void bendTones (float initFrequency, float finalFrequency, float prop, long noteDuration, int silentDuration);
|
|
|
|
void sing(int songName);
|
|
|
|
|
|
|
|
//-- Gestures
|
|
|
|
void playGesture(int gesture);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
Adafruit_NeoPixel mouth;
|
|
|
|
|
|
|
|
int pinBuzzer;
|
|
|
|
int pinMouth;
|
|
|
|
|
|
|
|
unsigned long int getMouthShape(int number);
|
|
|
|
unsigned long int getAnimShape(int anim, int index);
|
|
|
|
void _execute(int A[4], int O[4], int T, double phase_diff[4], float steps);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-11-20 16:49:55 +00:00
|
|
|
extern SimpleExpressionsClass SimpleExpressions;
|
|
|
|
|
2017-11-20 13:59:19 +00:00
|
|
|
#endif
|