Servo & I2C Timer issue
Posted: Fri Feb 15, 2019 1:56 pm
I have a ESP32 that I am trying to use to drive a prop. In this I have a RGB sensor running on i2c and a servo. At start up, I call Wire.begin() to get I2C set up, and then set up my servo . At about this time I have the ESP32Servo Class is printing out to the serial monitor:
"PWM requested on ledcwrite channel 1 using timer 0
WARNING PWM channel 1 shares a timer with 0
changing the frequency to 1000.00 Hz will ALSO change channel 0
from its previous frequency of 50.00 Hz".
When I start the sketch, the I2C sensor works and reports its values to the serial monitor every second as it should, but once it becomes time for the servo to move, it knocks the I2C sensor offline. Using the return value from the ESP32Servo::attach() function, it tells me that it is using channel 1.
From what I can determine, this is simply an issue of one of the 4 timers being used for two separate things and conflicting. I THINK its an issue with the I2C clock using the same timer as the Servo. It may be worth noting that I have the I2C clock running at 10000.
Can anyone advise what would be the best way to handle this?
"PWM requested on ledcwrite channel 1 using timer 0
WARNING PWM channel 1 shares a timer with 0
changing the frequency to 1000.00 Hz will ALSO change channel 0
from its previous frequency of 50.00 Hz".
When I start the sketch, the I2C sensor works and reports its values to the serial monitor every second as it should, but once it becomes time for the servo to move, it knocks the I2C sensor offline. Using the return value from the ESP32Servo::attach() function, it tells me that it is using channel 1.
From what I can determine, this is simply an issue of one of the 4 timers being used for two separate things and conflicting. I THINK its an issue with the I2C clock using the same timer as the Servo. It may be worth noting that I have the I2C clock running at 10000.
Can anyone advise what would be the best way to handle this?