smart-leds-rs / ws2812-spi-rs

Use ws2812 on rust with embedded-hal spi
Apache License 2.0
64 stars 23 forks source link

Documentation suggestion: Include Screen Captures of Logic Analyzer Timing with examples #17

Closed LongLiveCHIEF closed 3 years ago

LongLiveCHIEF commented 3 years ago

One thing I've struggled with as I've been debugging my code, is figuring out what the timing should look like on the logic analyzer.

I eventually got there, but in an effort to be more friendly to newcomers to rust and embedded, it might help if we shared some simple screen captures of what the SPI clock and mosi might look like with a few of the basic examples, so we can help newcomers learn how to associate pixels to SPI data.

I'm willing to make this contribution if you guys like the idea.

david-sawatzke commented 3 years ago

I've written something up: https://sawatzke.dev/blog1/ws2812-rust/

Is that close to what you had in mind?

LongLiveCHIEF commented 3 years ago

That's a really great piece, much cleaner than similar explanations out there. I was thinking what is particularly missing though is setting like a "smoke test". A known pattern and timing signal users can compare against so they at least know they've got their spi peripherals setup right.

I was thinking a good example would be showing what the miso and clock lines looked like a single blue pixel being toggled every second with spi at 3MHz, , and then another one showing what 20 blue pixels would look like getting toggled every minute.

Basically a known benchmark that users can run even without LED's hooked up, so that if they get unexpected led behavior it can help them identify if the issue is drift, electrical, or some other side effect.

On Sun, May 9, 2021, 4:24 PM david-sawatzke @.***> wrote:

I've written something up: https://sawatzke.dev/ws2812-rust/

Is that close to what you had in mind?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smart-leds-rs/ws2812-spi-rs/issues/17#issuecomment-835893803, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZBLALKP4GIULT43EX4ERLTM34PHANCNFSM44BKZJKA .

david-sawatzke commented 3 years ago

Hmm, that seems like a real separate thing. If you could to write something up, we should include it in the wiki (no idea how access rights work there) or in a docs folder, it'll be pretty helpful to verify if the timings work out. Not sure if multiple different variations help, I think a single (one led?) pattern should suffice.

I'd probably also include a very short intro to LAs, since many people don't know about them (something like: they're like binary scopes, you can get good enough ones for less than 10 bucks, use 'em with sigrok & look at the samplerate).