hpwit / I2SClocklessVirtualLedDriver

MIT License
28 stars 4 forks source link

Ability to set custom number of pins of every shift register #19

Closed particlerain closed 2 months ago

particlerain commented 5 months ago

Hi Yves,

I need to use just 5 pins of every shift register, sometimes 4 or 6. Is there a possibility in your driver to set the needed pins of shift registers as a define? For example first 5 outputs of first register will be universe 0-4, skip 3 outputs, then on the next register the first 5 outputs will be universe 5-9 etc. Because now when i send 10 universes it uses automatically 8 pins of first register and 2 pins of second register. I would like to organise the shift registers, so that each register outputs 5 universes.

Thanks for any help.

hpwit commented 5 months ago

Hello Normally it's possible the first version of the driver it was 5 pons per shift register. I need to see if with all the modifications I have made for it to work with 8pins it's still gonna work by changing the virtual pins number. I would certainly have to branch out an old version. Can you give me a feedback on the driver (how many pins how many leds) are you happy with it ? Which artnet library are you using? Regards

particlerain commented 5 months ago

Thanks for the reply. Yes i saw the 5pin version, you mean this library right : FASTLEDVIRTUALDRIVER I tested it but its stuck on 5 pins too. When i change the NUM_VIRT_PINS to for ex. 3 on this code (I2SClocklessVirtualLedDriver ) , the code does not output anything on any pins. There should be a more easy way to set the used pins on each shift register. I am quite happy with this library here. I am using 4 shift registers with 4 strips on each shift register but i want to be able to change the used pins so i dont need to make everytime e new board for pin header mapping , because i would like to use 2x4 pin headers with flat cables for each shift register output. I am using your great artnetesp32v2 library.

thanks

particlerain commented 5 months ago

In short, If you can, i just actually need to skip the unused bits of the shift register. or the int pins variable for the esp32 outputs should also be available for the shift registers for mapping all the register outputs like :

int used_pins_per_shift_register[4] {0,1,2,3}

or: int used_pins_per_shift_register[6] {2,1,4,3,0,7}

or map shift registers individually:

int used_pins_shift_register_1[2] {2,1} int used_pins_shift_register_2[4] {0,1,4,3} int used_pins_shift_register_3[6] {7,1,4,3,0,6}

thanks for your time and help

hpwit commented 5 months ago

This is because you need to change the speed of the i2s bus and at that time i did not program is to be changeable. Plus this driver is old and inefficient. The new one also has this parameter but i need some tweaking to make it go the entire driver now.

particlerain commented 5 months ago

yes i noticed that changing the pin count of the registers needs to be adjusted also in the i2s bus. i am using your latest code I2SClocklessVirtualLedDriver 2.1 TITUS. Its not urgent, just a suggestion that in the future it would be more flexible to work with adjustable register pins.