mirror of
https://github.com/s00500/SimpleExpressions
synced 2024-11-21 23:10:54 +00:00
fixing init methods
This commit is contained in:
parent
1898615bab
commit
ea9fabe9a4
@ -4,21 +4,13 @@
|
|||||||
#define ledc_channel 5
|
#define ledc_channel 5
|
||||||
|
|
||||||
void SimpleExpressionsClass::init(int aMouthPin, int aBuzzerPin) {
|
void SimpleExpressionsClass::init(int aMouthPin, int aBuzzerPin) {
|
||||||
mouth = Adafruit_NeoPixel(7, aMouthPin, NEO_GRB + NEO_KHZ800);
|
initMouth(aMouthPin);
|
||||||
mouth.begin();
|
initBuzzer(aBuzzerPin);
|
||||||
|
|
||||||
buzzerPin = aBuzzerPin;
|
|
||||||
|
|
||||||
#if defined(ESP32)
|
|
||||||
ledcSetup(ledc_channel, 2000, 8); // channel, max frequency, resolution
|
|
||||||
ledcAttachPin(aBuzzerPin, ledc_channel);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
clearMouth();
|
clearMouth();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleExpressionsClass::init(int aMouthPin, int aBuzzerPin) {
|
|
||||||
|
void SimpleExpressionsClass::initMouth(int aMouthPin) {
|
||||||
mouth = Adafruit_NeoPixel(7, aMouthPin, NEO_GRB + NEO_KHZ800);
|
mouth = Adafruit_NeoPixel(7, aMouthPin, NEO_GRB + NEO_KHZ800);
|
||||||
mouth.begin();
|
mouth.begin();
|
||||||
clearMouth();
|
clearMouth();
|
||||||
|
Loading…
Reference in New Issue
Block a user