#graphics #no-std

no-std emb-ssdraw

A simple embedded screen saver that draws random points on a display

1 unstable release

0.1.0 Dec 25, 2024

#1155 in Embedded development

Download history 146/week @ 2024-12-24 2/week @ 2025-01-07

148 downloads per month

MIT license

5KB

emb-ssdraw

A simple embedded screen saver that draws random points on a display. This crate is designed for no_std environments and uses the embedded-graphics library.

Features

  • No heap allocation (no_std compatible)
  • Configurable buffer size for points
  • Uses rand crate

See docs for more details.


lib.rs:

A simple screen saver for the display

This is a simple screen saver that draws a random number of points on the display.

Usage

Cargo.toml

[dependencies]
rand = { version = "0.8.5", features = ["small_rng"], default-features = false }

src/main.rs

use rand::rngs::SmallRng;
use rand::SeedableRng;

let mut rng = SmallRng::seed_from_u64(42);
let mut screen_saver = ScreenSaver::<_, 32>::new(rng);
let mut display = Display::new();
loop {
    display.clear();
    screen_saver.tick_draw(&mut display);
    display.flush();
}

Dependencies

~4MB
~48K SLoC