-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise led limit to a theorycaly 65025 #254
base: master
Are you sure you want to change the base?
Conversation
This reverts commit e6631b2.
I'd be open to considering this if we can get a confirmation that it doesn't cause any issues for the more widely used use case which is < 256 LEDs. Is anyone else able to test this? |
@joeybab3 If I rember it's just using a uint 16 instead of an uint 8 |
Im trying this with 300 Leds on an esp8266 and instead of using all 300 the Scroll effct stops at 256 and on the other side when it reaches LED number 0 it changes direction and scrolls back in direction where it comes from 44 LEDs. |
Oups no forgot to update the INO file |
@HerbertHorst the INO for the esp8266 was updated and it doensn't seem to be an issue with the ESP those lines packetBuffer[len] = 0;
N = ((packetBuffer[i] << 8) + packetBuffer[i + 1]);
RgbColor pixel((uint8_t)packetBuffer[i+2], (uint8_t)packetBuffer[i+3], (uint8_t)packetBuffer[i+4]);//color
ledstrip.SetPixelColor(N, pixel);//N is the pixel number Sound like in you code you have |
To explai a bit can only contain 8bit b1111111 is xFF (255), 256 is b100000000 x100 To go higher of the 255 limit we had to use uin16 2 byte the first byte withe the lefts ones and the second with the right ones so if the value is 300 you will have the uint b100101100 To encode that on two uint 8 we shift 8 bits the right so it become b1 the b00101100 are kida out Then you receive both, you shift b1 << 8 it becomes 256 and you adition b00101100 (44) and 256+44=300 It's just cutting the binary string in two and recombing it because you can only handle 8bit at time |
I double checked that my ESP is flashed with the right code and also not broken (minimizing LED count function proberly so it really flashes). Im very new to python and this Project so im not sure if the following that I checked make sense. |
@HerbertHorst It's not your strip it's really an issue with N value Can you add this to your code after
|
@BenoitAnastay Here the output after adding the few lines and running led.py (strandtest) |
Ok thanks for the report, I had forgot to change N to uint16, it was receiving the correct data stream but there was an overflow on the N variabla. It's now fixed, checkout the last commit 1264324 |
I coded the LED id on two bytes, I'm able to drive 576 leds with my ESP8266 lag free (I dont have more leds to test)
For my personal usage I also change the number of update per packet and the buffer size but this PR is the minimal requirement tu use more LEDs