|
@ -13,7 +13,6 @@ Pusher::Pusher(void) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Pusher::setup(void) { |
|
|
void Pusher::setup(void) { |
|
|
int channel = 13; // LEDC_CHANNEL_3 // beware: some channels interfere with the rmt peripheral used by FastLED
|
|
|
|
|
|
ledcSetup(channel, 50, TIMER_WIDTH); |
|
|
ledcSetup(channel, 50, TIMER_WIDTH); |
|
|
for(int pin : SERVO_PINS) { |
|
|
for(int pin : SERVO_PINS) { |
|
|
if (xSemaphoreTake(xSemaphore, TIMEOUT) == pdTRUE) { |
|
|
if (xSemaphoreTake(xSemaphore, TIMEOUT) == pdTRUE) { |
|
@ -30,11 +29,7 @@ void Pusher::setup(void) { |
|
|
|
|
|
|
|
|
void Pusher::push(int num) { |
|
|
void Pusher::push(int num) { |
|
|
if (xSemaphoreTake(xSemaphore, TIMEOUT) == pdTRUE) { |
|
|
if (xSemaphoreTake(xSemaphore, TIMEOUT) == pdTRUE) { |
|
|
int channel = 1; |
|
|
|
|
|
int pin = SERVO_PINS[num]; |
|
|
int pin = SERVO_PINS[num]; |
|
|
if (channel >= LEDC_NUM_CHANNELS) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
// ledcSetup(channel, 50, TIMER_WIDTH);
|
|
|
// ledcSetup(channel, 50, TIMER_WIDTH);
|
|
|
ledcAttachPin(pin, channel); |
|
|
ledcAttachPin(pin, channel); |
|
|
ledcWrite(channel, MIN_PULSE_WIDTH); |
|
|
ledcWrite(channel, MIN_PULSE_WIDTH); |
|
|