summaryrefslogtreecommitdiff
path: root/libraries/ESP32Servo/examples/ToneExample/ToneExample.ino
blob: 958ac03126b1884f69963a65deed5ce8655987fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*


 */

#include <ESP32Servo.h>
int pin = 2;
void setup() {
	// Allow allocation of all timers
	ESP32PWM::allocateTimer(0);
	ESP32PWM::allocateTimer(1);
	ESP32PWM::allocateTimer(2);
	ESP32PWM::allocateTimer(3);
	Serial.begin(115200);

}

void loop() {
	tone(pin, 4186, // C
			500); // half a second
	tone(pin, 5274, // E
			500); // half a second
	delay(500);

}