From ab07a6d62bdef1df9529a7e5070c3aea4cfa011e Mon Sep 17 00:00:00 2001 From: ImplFerris Date: Wed, 18 Dec 2024 16:19:37 +0530 Subject: [PATCH] added datasheet link for ssd1306 --- src/oled/hello-oled.md | 3 +++ src/oled/index.md | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/oled/hello-oled.md b/src/oled/hello-oled.md index bc0740a..e292457 100644 --- a/src/oled/hello-oled.md +++ b/src/oled/hello-oled.md @@ -79,6 +79,7 @@ display.init().unwrap(); ### Set Text Style and Draw Next, we define the text style and use it to display "Hello Rust" on the screen: + ```rust // Embedded graphics let text_style = MonoTextStyleBuilder::new() @@ -90,7 +91,9 @@ Text::with_baseline("Hello, Rust!", Point::new(0, 16), text_style, Baseline::Top .draw(&mut display) .unwrap(); ``` +Here, we are writing the message at coordinates (x=0, y=16). + ### Write out data to a display ```rust display.flush().unwrap(); diff --git a/src/oled/index.md b/src/oled/index.md index 9bb9638..2acaa30 100644 --- a/src/oled/index.md +++ b/src/oled/index.md @@ -6,6 +6,8 @@ We'll create simple projects like displaying text and an image (display Ferris pico2 + + ### Hardware Requirements For this project, you'll need: @@ -13,6 +15,7 @@ For this project, you'll need: - A breadboard - Jumper wires + ## Setup @@ -80,3 +83,6 @@ In addition to the usual crate like `rp-hal`, we will be using these new crates - [`embedded-graphics`](https://github.com/embedded-graphics/embedded-graphics): a 2D graphics library tailored for memory-constrained embedded devices, enabling text and graphic rendering. - [`tinybmp`](https://github.com/embedded-graphics/tinybmp): a lightweight BMP parser for embedded, no-std environments. We'll use this to directly load `.bmp` images with the `embedded-graphics` crate, avoiding the need for raw image data. +## Resources + +- [SSD1306 Datasheet](https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf)