mirror of
				https://github.com/s00500/SimpleExpressions
				synced 2025-10-31 02:03:26 +00:00 
			
		
		
		
	fixing init methods
This commit is contained in:
		| @@ -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(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user