Coder Social home page Coder Social logo

Comments (4)

bugadani avatar bugadani commented on August 16, 2024 1

Can you try the github master version of the crate? You are using the new embedded-graphics which isn't yet supported by the released version of this crate.

from ssd1306.

bugadani avatar bugadani commented on August 16, 2024 1

You can't use Rgb565 with this display, you can only use BinaryColor which has an On and an Off option.

from ssd1306.

work-in-progress-danny avatar work-in-progress-danny commented on August 16, 2024

Same code*

Cargo.toml

[dependencies]
panic-halt = "0.2.0"
ufmt = "0.1.0"
nb = "0.1.2"
embedded-hal = "0.2.3"
ssd1306 = { git = "https://github.com/jamwaffles/ssd1306.git", branch = "master" }
embedded-graphics = "0.8.0"

New Error

error[E0271]: type mismatch resolving `<Ssd1306<I2CInterface<avr_hal_generic::i2c::I2c<Atmega, arduino_hal::pac::TWI, avr_hal_generic::port::Pin<Input, PC4>, avr_hal_generic::port::Pin<Input, PC5>, MHz16>>, ssd1306::prelude::DisplaySize128x64, BufferedGraphicsMode<ssd1306::prelude::DisplaySize128x64>> as DrawTarget>::Color == Rgb565`
   --> src/main.rs:35:10
    |
35  |         .draw(&mut display)
    |          ^^^^ expected struct `Rgb565`, found enum `BinaryColor`
    |
note: required by a bound in `embedded_graphics::Drawable::draw`
   --> /Users/danny/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-graphics-core-0.4.0/src/drawable.rs:106:23
    |
106 |         D: DrawTarget<Color = Self::Color>;
    |                       ^^^^^^^^^^^^^^^^^^^ required by this bound in `embedded_graphics::Drawable::draw`

from ssd1306.

work-in-progress-danny avatar work-in-progress-danny commented on August 16, 2024

Thanks @bugadani it was the embedded_graphics::pixelcolor::Rgb565, instead using embedded_graphics::pixelcolor::binarycolor fixed it 🚀

from ssd1306.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.