You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
today I replaced my analogWrite() based stuff by you library. All my flicker-issues immediately disappeared - great work!
The only drawback for me is that the use of your library from an Arduino sketch is quite un-intuitive:
I use the pre-defined pins D1...D3. I had to find out what the real GIPOs are (5,4 and 0). Then I had to find out the register names (PERIPHS_IO_MUX_GPIO5_U, PERIPHS_IO_MUX_GPIO4_U, PERIPHS_IO_MUX_GPIO0_U)
To write PWM values, I have to use indices (0,1,2), not GPIO pins or D1...D3. And I always have to call pwm_start() after each change.
It would be great if there where a wrapper around your lib, so that it can easily be used as library in arduino. What do you think about this?
Regards,
Michael.
The text was updated successfully, but these errors were encountered:
Second, Arduino was developed for small Atmel uCs, and shoehorning it onto other uCs is IMHO not a very good idea:
"original" ESP boards (ESP-07, ESP-12, ...) don't have any D1,D2, ... pins, but GPIOs 0 to 16, which are clearly labeled on its silkscreen. Using Arduino naming on these boards would be confusing, at least.
The Atmel HW PWM has different modes, timer predividers, ... whereas this SW PWM has a single mode with coupled PWM frequency and resolution.
If your ESP board has its GPIOs labeled D1, D2 ... but does not provide any documentation how these are mapped to the ESP8266 GPIOs, you should give the vendor a hit with the cluebat.
So, if you prefer to use D1 as the GPIO name, as it is (mis-)labeled as such on your board, you can just use
#define D1 0
#define D2 1
...
in your code and use these as the indices.
If you want to omit the pwm_start() call, just wrap it together with the pwm_set_duty(...) call. Drawback is if you e.g. change 3 channels at the same time, you end up calling pwm_start() three times instead of once.
Hello,
today I replaced my analogWrite() based stuff by you library. All my flicker-issues immediately disappeared - great work!
The only drawback for me is that the use of your library from an Arduino sketch is quite un-intuitive:
I use the pre-defined pins D1...D3. I had to find out what the real GIPOs are (5,4 and 0). Then I had to find out the register names (PERIPHS_IO_MUX_GPIO5_U, PERIPHS_IO_MUX_GPIO4_U, PERIPHS_IO_MUX_GPIO0_U)
To write PWM values, I have to use indices (0,1,2), not GPIO pins or D1...D3. And I always have to call pwm_start() after each change.
It would be great if there where a wrapper around your lib, so that it can easily be used as library in arduino. What do you think about this?
Regards,
Michael.
The text was updated successfully, but these errors were encountered: