lemariva / uPyCam

Take a photo with an ESP32-CAM running MicroPython
https://lemariva.com/blog/2019/09/micropython-how-about-taking-photo-esp32
Apache License 2.0
140 stars 42 forks source link

Issues when using camera driver in parallel with PWM #8

Open jischebeck opened 4 years ago

jischebeck commented 4 years ago

Hi Lemariva,

the driver is great and works perfect standalone.

When combined with PWM to control servos, either the system reboots, fails to initialize the camera or the servos don't work anymore.

Could it be due to the Timer used? TIMER_0 for Camera, TIMER_1 for PWN ? Do you have any idea?

Jan

I added the following PWM to the webcam.py: servo_r = machine.PWM(machine.Pin(12), freq=50,duty=0) servo_l = machine.PWM(machine.Pin(13), freq=50,duty=0)

lemariva commented 4 years ago
jischebeck commented 4 years ago

It works fine without the camera driver. If I run it on different channels / timers it works fine. At https://robotzero.one/esp32-cam-rc-car/ someone run into the same problem, and got it solved with different channels.

Unfortunately, this can't be repeated easily using micropython, as there you cannot change the channels/times.