np = require("neopixel");
// set first five neopixel blue on pin D16 - ok
np.write(D16,[0,0,40, 0,0,40, 0,0,40, 0,0,40, 0,0,40]);
// set first five neopixel green on pin D17 - changes pixel on D16 to green too - err
np.write(D17,[40,0,0, 40,0,0, 40,0,0, 40,0,0, 40,0,0])
The neopixel implementation does not detach pins which is causing this effect.
First approche to fix this:
int neopixelConfiguredGPIO = -1;
....
void neopixel_init(int gpioNum){
....
if (neopixelConfiguredGPIO != gpioNum) {
// detach last pin
if (neopixelConfiguredGPIO)
gpio_matrix_out(neopixelConfiguredGPIO,0,0,0);
neopixelConfiguredGPIO = gpioNum;
}
rmt_set_pin((rmt_channel_t)RMTCHANNEL, RMT_MODE_TX, (gpio_num_t)gpioNum);
....
}
Same behavior for all ESP-IDF versions. Needs more testing before sending a pr.
Test Code:
The neopixel implementation does not detach pins which is causing this effect.
First approche to fix this:
Same behavior for all ESP-IDF versions. Needs more testing before sending a pr.