Skip to content

Black bar on top of my screen #242

@ClemPera

Description

@ClemPera

Hardware

  • Waveshare 2.13inch rev2.1 v3
  • ESP32s3

Issue

My screen has a big black bar on top (with random pixels on top of it). Please see the image below.

Image

Code

use epd_waveshare::{epd2in13_v2::*, prelude::*};
use embedded_graphics::{
    mono_font::{iso_8859_7::FONT_10X20, MonoTextStyle}, prelude::*, primitives::Rectangle, text::Text
};
use esp_idf_svc::hal::{delay::Ets, gpio::{AnyIOPin, PinDriver}, spi::{config::Config, SpiDriverConfig}};
use esp_idf_svc::hal::spi::SpiDeviceDriver;
use esp_idf_svc::hal::prelude::Peripherals;

fn main() {
  esp_idf_svc::sys::link_patches();
  
  let peripherals = Peripherals::take().unwrap();
  let pins = peripherals.pins;

  let spi = peripherals.spi2;
  let sclk = pins.gpio12;
  let sdo = pins.gpio11;
  let busy_in = PinDriver::input(pins.gpio16).unwrap();
  let dc = PinDriver::output(pins.gpio18).unwrap();
  let rst = PinDriver::output(pins.gpio17).unwrap();

  let mut device = SpiDeviceDriver::new_single(
    spi, 
    sclk, 
    sdo, 
    Option::<AnyIOPin>::None, 
    Some(pins.gpio8), 
    &SpiDriverConfig::default(), 
    &Config::new().baudrate(112500.into()) 
  ).unwrap();

  let mut delay = Ets;
  
  // Setup EPD
  let mut epd = Epd2in13::new(&mut device, busy_in, dc, rst, &mut delay, None).unwrap();
  
  // Use display graphics from embedded-graphics
  let mut display = Display2in13::default();

  display.clear(Color::White).unwrap();
  display.set_rotation(DisplayRotation::Rotate90);
  
  // Display updated frame
  epd.update_and_display_frame(&mut device, &display.buffer(), &mut delay).unwrap();
  
  // Set the EPD to sleep
  epd.sleep(&mut device, &mut delay).unwrap();
}

Workaround

My workaround around that is modifying WIDTH on the mod.rs file to around 130 instead of 122.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions