cat-in-136 / ws2812-esp32-rmt-driver

WS2812 driver using ESP32 RMT for Rust
MIT License
40 stars 21 forks source link

write method not found method not found in `LedPixelEsp32Rmt #40

Closed reggi closed 4 months ago

reggi commented 4 months ago

new to rust in general

Issue with example:

https://github.com/cat-in-136/ws2812-esp32-rmt-driver/blob/main/examples/m5atom_smart_leds.rs#L29

no method named write found for struct LedPixelEsp32Rmt in the current scope items from traits can only be used if the trait is in scoperustcClick for full compiler diagnostic lib.rs(33, 8): the method is available for LedPixelEsp32Rmt<'_, RGB<u8>, LedPixelColorImpl<3, 1, 0, 2, 255>> here main.rs(1, 1): the following trait is implemented but not in scope; perhaps add a use for it:: `use smart_leds_trait::SmartLedsWrite;

cat-in-136 commented 4 months ago

Too less information to understanding what you faced. If you are writing your own program (i.e. you are not using just exactly same my example code), I agree that it is reasonable to miss use line as like <https://github.com/cat-in-136/ws2812-esp32-rmt-driver/blob/ecb9db908ee16d538da127df361a8d850be2ab4b/ examples/m5atom_smart_leds.rs#L4> is missing.

reggi commented 4 months ago

I gave up on learning rust for now with the cardputer just gonna just c++

I had cargo conflicts and duplicate types it was a mess. https://stackoverflow.com/questions/78003487/cargo-package-conflicts

reggi commented 4 months ago

@cat-in-136 I do appreciate your code and effort here perhaps will revisit one day, thank you for your work!

nicocti commented 3 months ago

Hi, the issue is that the SmartLedsWrite trait was changed upstream: https://github.com/smart-leds-rs/smart-leds-trait/commit/d74c51ee2490ec213cd19165c16caec6f53aca36

The example works if smart-leds-trait is frozen to v0.2.1 instead of v0.3.0.