Samples/samples/Graphics/Screens at main · nanoframework/Samples · GitHub
Skip to content

Latest commit

 

History

History

Screens

README.md

🌶️🌶️ - Screen samples

These samples demonstrate the low level text display and graphics display functions that are available.

These are very useful for memory constrained devices with smaller screens.

To initialize the screen, DisplayControl.Initialize, requires SPIConfiguration and ScreenConfiguration please check below.

If backLightPin and reset are not used, you can use -1 as a value. ScreenConfiguration requires screen size of your actual screen as screenWidth and screenHeight.

DisplayControl.Initialize(
    new SpiConfiguration(spiBus, chipSelect, dataCommand, reset, backLightPin), 
    new ScreenConfiguration(0, 0, screenWidth, screenHeight),
    screenBufferSize);

For different font family and font sizes, you can generate tinyfont. You can find more information about tinyfont on this blog

M5Stack Screen

M5Stack Screen was tested in:

The features demonstrated are:

  • Text display and formatting.

Configuration:

// pins for SPI Configuration
backLightPin = 32;
chipSelect = 14;
dataCommand = 27;
reset = 33;

// set MISO, MOSI and CLOCK pins
Configuration.SetPinFunction(19, DeviceFunction.SPI1_MISO);
Configuration.SetPinFunction(23, DeviceFunction.SPI1_MOSI);
Configuration.SetPinFunction(18, DeviceFunction.SPI1_CLOCK);

When running this sample, the end result in the screen looks like this:

m5stack

M5Stick Screen

M5Stick Screen was tested in:

Before displaying the screen don't forget to initialize AXP192 first, you can check InitiM5Stick() in Program.cs of m5stick.screen sample. The features demonstrated are:

  • Using AXP192 to initialize the screen
  • Graphics display and formatting.
  • Text display and formatting.

Configuration:

// pins for SPI Configuration
int backLightPin = -1;
int chipSelect = 5;
int dataCommand = 23;
int reset = 18;

// set MISO, MOSI and CLOCK pins
Configuration.SetPinFunction(4, DeviceFunction.SPI1_MISO);
Configuration.SetPinFunction(15, DeviceFunction.SPI1_MOSI);
Configuration.SetPinFunction(13, DeviceFunction.SPI1_CLOCK);

Wroover

Configuration:

// pins for SPI Configuration
backLightPin = 5;
chipSelect = 22;
dataCommand = 21;
reset = 18;

// set MISO, MOSI and CLOCK pins
Configuration.SetPinFunction(19, DeviceFunction.SPI1_MISO);
Configuration.SetPinFunction(23, DeviceFunction.SPI1_MOSI);
Configuration.SetPinFunction(18, DeviceFunction.SPI1_CLOCK);

ESP32-S3-BOX-Lite Screen

ESP32-S3-BOX-Lite Screen demonstrates driving the 320x240 ST7789 LCD of the Espressif ESP32-S3-BOX-Lite with a managed (generic) graphic driver. It also documents the board sensors (spoiler: no IMU nor touch, only the microphones). The features demonstrated are:

  • Building a managed ST7789 graphic driver.
  • Filling the screen and drawing colored regions.

Configuration:

// pins for SPI Configuration
int backLightPin = 45;
int chipSelect = 5;
int dataCommand = 4;
int reset = 48;

// set MISO, MOSI and CLOCK pins (MISO is unused by the panel)
Configuration.SetPinFunction(39, DeviceFunction.SPI1_MISO);
Configuration.SetPinFunction(6, DeviceFunction.SPI1_MOSI);
Configuration.SetPinFunction(7, DeviceFunction.SPI1_CLOCK);

Waveshare ESP32-S3-Touch-LCD-2 Screen

Waveshare ESP32-S3-Touch-LCD-2 screen test drives the board's 240x320 ST7789 LCD in portrait mode using a managed graphic driver. It displays full-screen colors, a text page with pangrams and both alphabets, color bars, a gray ramp, edge/corner markers, and an animated square to test partial updates.

Use ESP32_S3_OCTAL, not QUAD: this board's ESP32-S3R8 has 8 MB octal PSRAM. The firmware must include the Generic SPI graphic driver. The sample README includes flashing, deployment, and visual verification instructions.

LCD pins: MOSI 38, clock 39, CS 45, DC 42, backlight 1; reset is not connected to an ESP32 GPIO (-1). The shared SPI MISO line is GPIO40.