Open Truebsal opened 5 years ago
#define TONE_LEDC_CHANNEL (0)
void tone(uint8_t pin, unsigned int frequency)
{
if (ledcRead(TONE_LEDC_CHANNEL))
{
Serial.printf("Tone channel %d is already in use\r\n", ledcRead(TONE_LEDC_CHANNEL));
return;
}
ledcAttachPin(pin, TONE_LEDC_CHANNEL);
ledcWriteTone(TONE_LEDC_CHANNEL, frequency);
}
void noTone(uint8_t pin)
{
ledcDetachPin(pin);
ledcWrite(TONE_LEDC_CHANNEL, 0);
}
error: 'tone' / 'notone' was not declared in this scope for esp32