Commit d2a1474e authored by TechnoElf's avatar TechnoElf
Browse files

Draw text

parent e8e7cc27
......@@ -3,8 +3,12 @@ use rppal::spi::{Spi, Bus, SlaveSelect, Mode};
use rppal::gpio::Gpio;
use st7789::{ST7789, Orientation};
use display_interface_spi::SPIInterfaceNoCS;
use embedded_graphics::prelude::*;
use embedded_graphics::pixelcolor::Rgb565;
use embedded_graphics::draw_target::DrawTarget;
use embedded_graphics::mono_font::ascii::FONT_6X13;
use embedded_graphics::mono_font::MonoTextStyle;
use embedded_graphics::text::Text;
fn main() {
let spi_bus = Spi::new(Bus::Spi0, SlaveSelect::Ss0, 5000000, Mode::Mode0).unwrap();
......@@ -18,5 +22,8 @@ fn main() {
display.init(&mut Delay::new()).unwrap();
display.clear(Rgb565::new(255, 0, 0)).unwrap();
display.clear(Rgb565::new(255, 255, 255)).unwrap();
let style = MonoTextStyle::new(&FONT_6X13, Rgb565::new(0, 0, 0));
Text::new("Release the Kraken!", Point::new(0, 0), style).draw(&mut display).unwrap();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment