47 lines
1.0 KiB
C++
Executable File
47 lines
1.0 KiB
C++
Executable File
#ifndef SimpleExpressions_h
|
|
#define SimpleExpressions_h
|
|
#include <Adafruit_NeoPixel.h>
|
|
#ifdef __AVR__
|
|
#include <avr/power.h>
|
|
#endif
|
|
|
|
#include "Shapes.h"
|
|
|
|
|
|
|
|
class SimpleExpressionsClass
|
|
{
|
|
public:
|
|
|
|
void init(int mouthPin, int buzzerPin);
|
|
|
|
void writeMouth(int mouth);
|
|
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);
|
|
|
|
};
|
|
|
|
extern SimpleExpressionsClass SimpleExpressions;
|
|
|
|
#endif
|