I need to have 2 pin fade in and out with the same timing, but with a twist. I need them to be exactly 180 deg. apart from one another.
i.e. when pin(a) is at its highest intensity of it's fade cycle, it's at that point when pin(b) is at its lowest.
2 LEDC channels, 180 deg. apart
Re: 2 LEDC channels, 180 deg. apart
Take a look at a nand gate. But I bet there will be another twist... LED average current and its observable brightness are not linear.
I think there is no alternative than to just use 2 PWM channels.
I think there is no alternative than to just use 2 PWM channels.
Re: 2 LEDC channels, 180 deg. apart
Thanks, but the truth be told i need 3 pins, all 120 deg. apart.
I am trying a crazy idea to use 3 LEDC pins to implement SPWM to control a BLDC motor.
I am trying a crazy idea to use 3 LEDC pins to implement SPWM to control a BLDC motor.
-
- Posts: 118
- Joined: Tue Jun 26, 2018 3:09 am
Re: 2 LEDC channels, 180 deg. apart
Hi, mikemoy
In the LEDC channel configuration parameters, we provide hpoint to configure the phase. Plese note that these three channels need to use the same timer.
In the LEDC channel configuration parameters, we provide hpoint to configure the phase. Plese note that these three channels need to use the same timer.
Code: Select all
typedef struct {
int gpio_num;
....
uint32_t duty;
int hpoint;
} ledc_channel_config_t;
wookooho
Who is online
Users browsing this forum: No registered users and 122 guests