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-21 11:17:37 +00:00
|
|
|
void writeMouth(int mouth);
|
2017-11-20 13:59:19 +00:00
|
|
|
void clearMouth();
|
|
|
|
|
2017-11-21 12:09:40 +00:00
|
|
|
void writeMouthRecolored(int mouth, u_int32 color);
|
|
|
|
void writeMouthGeneric(int[7][3] mouthArray);
|
|
|
|
|
|
|
|
void putAnimationMouth(unsigned long int anim, int index);
|
|
|
|
|
2017-11-20 13:59:19 +00:00
|
|
|
//-- 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;
|
|
|
|
|
|
|
|
unsigned long int getMouthShape(int number);
|
|
|
|
unsigned long int getAnimShape(int anim, int index);
|
|
|
|
};
|
|
|
|
|
2017-11-20 16:49:55 +00:00
|
|
|
extern SimpleExpressionsClass SimpleExpressions;
|
|
|
|
|
2017-11-20 13:59:19 +00:00
|
|
|
#endif
|