So it works if you lower the data rate? Is it possible to just lower the Baud rate on Serial then?
Also, if you remove the print statements, that should help a lot.
The Pico has a 512 byte input buffer I think - I guess it's possible that so much data is arriving while the last data is being sent to the LEDs that it gets full up...
150 pixels * 24 bits = 3600, and each bit takes 1.25us to send, so that's 4.5ms. If you're receiving data at 1000000 baud then that's 100,000 bytes/sec, so in 4.5ms you're receiving 450 bytes.
Add some overhead for executing JS and you're dangerously close to overflowing that buffer... So the solution would either be to:
© Espruino, powered by microcosm.
Report a problem