1
0
mirror of https://github.com/s00500/SimpleExpressions synced 2024-11-23 21:20:55 +00:00

fixing init methods

This commit is contained in:
Lukas Bachschwell 2017-12-11 15:09:49 +01:00
parent 1898615bab
commit ea9fabe9a4
2 changed files with 6 additions and 14 deletions

View File

@ -4,21 +4,13 @@
#define ledc_channel 5
void SimpleExpressionsClass::init(int aMouthPin, int aBuzzerPin) {
mouth = Adafruit_NeoPixel(7, aMouthPin, NEO_GRB + NEO_KHZ800);
mouth.begin();
buzzerPin = aBuzzerPin;
#if defined(ESP32)
ledcSetup(ledc_channel, 2000, 8); // channel, max frequency, resolution
ledcAttachPin(aBuzzerPin, ledc_channel);
#endif
initMouth(aMouthPin);
initBuzzer(aBuzzerPin);
clearMouth();
}
void SimpleExpressionsClass::init(int aMouthPin, int aBuzzerPin) {
void SimpleExpressionsClass::initMouth(int aMouthPin) {
mouth = Adafruit_NeoPixel(7, aMouthPin, NEO_GRB + NEO_KHZ800);
mouth.begin();
clearMouth();

View File

@ -16,8 +16,8 @@ class SimpleExpressionsClass
public:
// General
void init(int mouthPin, int buzzerPin);
void initMouth(int mouthPin);
void initBuzzer(int buzzerPin);
void initMouth(int mouthPin);
void initBuzzer(int buzzerPin);
// Mouths
void printMouth(int number, int r, int g, int b);