1
0
mirror of https://github.com/s00500/SimpleExpressions synced 2024-10-31 22:50:53 +00:00
SimpleExpressions/SimpleExpressions.h

52 lines
1.1 KiB
C
Raw Normal View History

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-21 23:30:35 +00:00
#define debug true
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-23 11:28:47 +00:00
void writeMouth(char mouthName[], int r, int g, int b);
void printMouth(int number, int r, int g, int b);
2017-11-22 12:50:16 +00:00
void writeMouth(char mouthName[]);
2017-11-23 11:28:47 +00:00
void printMouth(int number);
2017-11-22 12:50:16 +00:00
2017-11-20 13:59:19 +00:00
void clearMouth();
2017-11-23 11:28:47 +00:00
void writeMouthGeneric(const bool mouthArray[7], int r, int g, int b);
2017-11-22 12:50:16 +00:00
void writeMouthGeneric(const int mouthArray[7][3]);
2017-11-21 12:09:40 +00:00
2017-11-23 11:28:47 +00:00
//void putAnimationMouth(int anim, int index);
2017-11-21 12:09:40 +00:00
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
2017-11-23 11:28:47 +00:00
//void playGesture(int gesture);
2017-11-20 13:59:19 +00:00
private:
int pinBuzzer;
2017-11-22 15:20:14 +00:00
Adafruit_NeoPixel mouth;
2017-11-20 13:59:19 +00:00
2017-11-22 12:50:16 +00:00
long int getMouthShape(int number);
long int getAnimShape(int anim, int index);
2017-11-20 13:59:19 +00:00
};
2017-11-20 16:49:55 +00:00
extern SimpleExpressionsClass SimpleExpressions;
2017-11-20 13:59:19 +00:00
#endif