| Crates.io | sh1107-driver |
| lib.rs | sh1107-driver |
| version | 0.1.0 |
| created_at | 2025-09-07 15:58:39.393194+00 |
| updated_at | 2025-09-07 15:58:39.393194+00 |
| description | I2C driver for the SH1107 display chip using embedded-hal |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1828278 |
| size | 27,930 |
NOTE: this driver only supports the 128x64 display version currently, 128x128 may be supported in the future, but I do not have the hardware to test it myself.
Driver for the Adafruit FeatherWing OLED 128x64, supporting I2C communication ONLY.
#![no_std] so it can be used with any chipgraphics feature for text rendering functionsThis library is still under development, and all contributions and suggestions are welcome.
// ...
use SH1107::{Rotation, SH1107Color};
use SH1107::SH1107;
fn main() {
// ... other setup code
let i2c_config = I2cConfig::new().baudrate(100.kHz().into());
let i2c = I2cDriver::new(
peripherals.i2c0,
peripherals.pins.gpio19,
peripherals.pins.gpio18,
&i2c_config,
)
.unwrap();
let mut sh1107 = SH1107::new(i2c);
sh1107.begin();
sh1107.rotation = Rotation::Wide;
sh1107.display_all();
sh1107.set_contrast(0x0F);
sh1107.draw_string("Hello world!", 0, 0, true);
sh1107.display_changed();
}