/ws-1in5-i2c

Primary LanguageRustMIT LicenseMIT

WS 1inch5 i2c Library

A library for interfacing with a Waveshare 1.5 Inch OLED over i2c.

This library supports drawing images and text to the screen using the rusttype crate, image crate, and imageproc crate.

Example

let font_data: &[u8] = include_bytes!("../font.ttf");
let font: Font<'static> = Font::try_from_bytes(font_data).expect("Valid font");
let scale10 = Scale::uniform(10.0);

let screen = WS1in5::new(30, 1, 27).unwrap();
screen.clear_all().unwrap();

screen.draw_centered_text(
    0,
    0,
    "Hello World",
    &scale10,
    &font,
    false
).unwrap();

License

This software is provided under the MIT license. Click here to view.