I am getting a compiling error when trying to write a simple program while including pwmWrite.h.
#include <pwmWrite.h>
#include <Arduino.h>
uint8_t tonePin = 4;
uint8_t potPin = 12;
uint16_t duration = 500; // tone duration ms
uint16_t interval = 0; // pause between tones ms
uint16_t state = 0;
Pwm pwm = Pwm(); // constructor
void setup() {
pinMode(potPin, INPUT); // sliding pot input
}
void loop() {
// PWM signal 1000HZ for 50ms long
// pwm.tone(tonePin, 1000, 50); // auto attaches to ch 0
delay(5000);
}
\Documents\Arduino\libraries\Common\pwmWrite.cpp: In member function 'void Pwm::tone(uint8_t, uint32_t, uint16_t, uint16_t)':
\Documents\Arduino\libraries\Common\pwmWrite.cpp:85:62: error: 'ledcChangeFrequency' was not declared in this scope
ledcChangeFrequency(ch, frequency, mem[ch].resolution);
^
\Documents\Arduino\libraries\Common\pwmWrite.cpp: In member function 'void Pwm::ledc_attach_with_invert(uint8_t, uint8_t)':
\Documents\Arduino\libraries\Common\pwmWrite.cpp:308:3: error: 'ledc_channel_config_t' has no non-static data member named 'flags'
};
^
exit status 1
Compilation error: exit status 1
Is there a library or something that I am missing? Should I be using PlatformIO?
I am using the ESP-32 and Arduino IDE 2.1.0.
Hello.
I am getting a compiling error when trying to write a simple program while including pwmWrite.h.
Is there a library or something that I am missing? Should I be using PlatformIO? I am using the ESP-32 and Arduino IDE 2.1.0.