ESP32 machine.PWM
-
- Posts: 16
- Joined: Thu Sep 30, 2021 9:45 am
Re: ESP32 machine.PWM
I have esp32, what is solution?
Re: ESP32 machine.PWM
Try to use the daily build: https://micropython.org/resources/firmw ... 2ebe09.bin.
See the web page for upload instructions: https://micropython.org/download/esp32/
See the web page for upload instructions: https://micropython.org/download/esp32/
-
- Posts: 16
- Joined: Thu Sep 30, 2021 9:45 am
Re: ESP32 machine.PWM
Thanks a lot!
I'll try and report my impressions!
I'll try and report my impressions!
-
- Posts: 16
- Joined: Thu Sep 30, 2021 9:45 am
Re: ESP32 machine.PWM
Sorry, it doesn't seem to be a mistake in the firmware and timing!
Is pwm.deinit () automatically sent commands to return the servo to the starting position and is it possible to change it?
This is my code for servo motor control:
'''klapna'''
class klapna:
def __init__(self, pozicija):
self.pozicija = pozicija
p2 = machine.Pin(32)
servo = machine.PWM(p2,freq = 50)
servo.duty(pozicija)
servo.deinit() # After servo.deinit() esp32 send min value of 95 every time
klapna(pozicija=130) # 95 - 130 min-max
Is pwm.deinit () automatically sent commands to return the servo to the starting position and is it possible to change it?
This is my code for servo motor control:
'''klapna'''
class klapna:
def __init__(self, pozicija):
self.pozicija = pozicija
p2 = machine.Pin(32)
servo = machine.PWM(p2,freq = 50)
servo.duty(pozicija)
servo.deinit() # After servo.deinit() esp32 send min value of 95 every time
klapna(pozicija=130) # 95 - 130 min-max
-
- Posts: 16
- Joined: Thu Sep 30, 2021 9:45 am
Re: ESP32 machine.PWM
I just tried this code on the MicroPython v1.16 on 2021-06-23; ESP32 module with ESP32, and everithing work!
That it is not a mistake in the version v1.17...?
That it is not a mistake in the version v1.17...?
Re: ESP32 machine.PWM
It may be that the deinit() method changed. Why do you call deinit()?
-
- Posts: 16
- Joined: Thu Sep 30, 2021 9:45 am
Re: ESP32 machine.PWM
In case I don't use deinit (), it's as if there is some interference (signal) that moves the servo in small movements!
I am not an expert in the field of microcontrollers ... My field of expertise is acoustics and audio signal processing ...
Is there an error in the code given in the previous post?
I am not an expert in the field of microcontrollers ... My field of expertise is acoustics and audio signal processing ...
Is there an error in the code given in the previous post?
Re: ESP32 machine.PWM
Is that constantly moving in one direction or moving forth and back?
Re: ESP32 machine.PWM
Which parameters do you use when this happens: freq, duty
Re: ESP32 machine.PWM
With respect to deinit(), I see no difference between v1.16 and v1.17. Both switch off the PWM signal.