mirror of
https://github.com/s00500/SimpleExpressions
synced 2024-06-01 08:43:26 +00:00
44 lines
954 B
C++
Executable File
44 lines
954 B
C++
Executable File
#ifndef SimpleMouth_h
|
|
#define SimpleMouth_h
|
|
#include <Adafruit_NeoPixel.h>
|
|
#ifdef __AVR__
|
|
#include <avr/power.h>
|
|
#endif
|
|
|
|
#include "Shapes.h"
|
|
|
|
|
|
|
|
class SimpleExpressions
|
|
{
|
|
public:
|
|
|
|
void init(int mouthPin, int buzzerPin);
|
|
|
|
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);
|
|
|
|
};
|
|
|
|
#endif
|