OpenELAB Wiki
  • 🚀Welcome to Our Wiki!
  • 1️⃣M5Stack
    • M5Stack Cardputer Kit w /M5StampS3
    • M5Stack Dial - ESP32-S3 Smart Rotary Knob
    • M5StickC PLUS2 ESP32 Mini IoT Development Kit
    • M5StickC PLUS ESP32-PICO Mini IoT Development Kit
    • M5Stack Core2 ESP32 IoT Development Kit for AWS IoT Kit
    • M5Stack Core2 ESP32 IoT Development Kit
    • M5Stack AtomS3 Lite ESP32S3 Dev Kit
    • M5Stack ATOMS3 Dev Kit w/ 0.85-inch Screen
    • M5Stack ATOM TailBat - Battery Accessory for ATOM
    • M5Stack ATOM Matrix ESP32 Development Kit
    • M5Stack ATOM Lite ESP32 IoT Development Kit
    • M5Stack ATOM Echo Smart Speaker Development Ki
    • M5Stack ENV III Unit with Temperature Humidity Air Pressure Sensor
    • M5Stack COMMU Module Extend RS485/TTL CAN/I2C Port
    • M5Stack ATOMIC PoE Base W5500
    • M5Stack Time-of-Flight Distance Unit (VL53L1X)
    • M5Stack LoRa Unit with Antenna(E220)
    • M5Stack Glass 2 Unit w/ 1.51inch Transparent OLED
    • M5Stack Temperature, Humidity, Pressure and Gas Sensor (BME688)
    • M5Stack Temperature Humidity Air Pressure Sensor (SHT40+BMP280)
    • M5Stack H-bridge Unit v1.1 (STM32F030)
    • M5Stack 8-Channel Servo Driver Unit (STM32F030)
    • M5Stack ATOMIC TTL-RS485 Base
    • M5Stack ATOMIC PortABC Extension Base
    • M5Stack Ext Encoder Unita (STM32F030)
    • M5Stack Single-phase DC SSR Unit (CDG1. 1DD-10A)
    • M5Stack Speaker 2 Hat (MAX98357)
    • M5Stack Glass Unit w/ 1.51inch Transparent OLED
    • M5StickC Vibration HAT
    • M5Stack RCA Audio/Video Composite Unit
    • M5Stack Barometric Pressure 2 Unit (QMP6988)
    • M5Stack 8-Angle Unit with Potentiometer
    • M5Stack 8-Encoder Unit (STM32F030)
    • M5Stack Flashlight Unit
    • M5Stack NCIR 2 Thermometer Unit (MLX90614)
    • M5Stack M5StickV K210 AI Camera (Without Wifi)
    • M5Stack Thermal Camera 2 Unit (MLX90640) -110 Degree FoV
    • M5Stack USB TypeC2Grove Unit
    • M5Stack Scales Unit with 20kgs Range (HX711)
    • M5Stack I/O Hub 1 to 6 Expansion Unit (STM32F0)
    • M5Stack Keyboard Programmable Unit V1.1 (MEGA8A)
    • M5Stack Red 7-Segment Digit Clock Unit
    • M5Stack Mechanical Key Button Unit
    • M5Stack ESP32 Ethernet Unit with PoE
    • M5Stack Encoder Unit
    • M5Stack MQTT PoE Unit with PoE Port
    • M5Stack Unit CamS3 Wi-Fi Camera 5MP
    • M5Stack Ultrasonic Distance Unit I2C
    • M5Stack Ultrasonic Distance Unit I/O
    • M5Stack Passive Buzzer Unit
    • M5Stack 2-Channel SPST Relay Unit
    • M5Stack Tube/Air Pressure Unit
    • M5Stack MQTT Unit with RJ45 Port
    • M5Stack Gesture recognition sensor
    • M5Stack Fader Unit with B10K Potentiometer
    • M5Stack I2C Hub 1 to 6 Expansion Unit
    • M5Stack Real Time Clock (RTC) Unit
    • M5Stack OLED Unit 1.3"Display
    • M5Stack RF UNIT 433MHz Transmitter
    • M5Stack ATOM Socket Kit
    • M5Stack Watering Unit with Mositure Sensor and Pump
    • M5Stack Digital RGB LED Strip
    • M5Stack M5StickC 18650C
    • M5Stack M5StickC SERVO HAT
    • M5Stack M5StickC Fingerprint HAT
    • M5Stack M5StickC ToF HAT
    • M5Stack Mini GPS/BDS Unit
    • M5Stack Finger Print Sensor Unit
    • M5Stack DAC Converter Digital
    • M5Stack RGB LED Unit
    • M5Stack Mini 3A Relay Unit
    • M5Stack Earth Moisture Sensor Unit
    • M5Stack Color Sensor RGB Unit
    • M5Stack Mini Angle Unit Rotary Switch
    • M5Stack PIR Motion Sensor
    • HEX RGB LED Board
    • M5Stack LoRa Module (433MHz) v1.1
    • M5Stack ATOMS3R Camera Kit
    • M5Stack ATOMS3R Development Kit
    • M5Stack Roller485 Lite Unit
    • M5Stack ATOMS3R Proto Kit
    • M5Stack M5Stamp Fly with M5StampS3
    • M5Stack M5Atom Joystick with M5AtomS3
    • M5Stack ATOMS3R Camera (OV3660)
    • M5Stack Battery Module
    • M5Stack Unit Cam Wi-Fi Camera
    • M5Stack PIR Motion Sensor
    • M5Stack RFID 2 Unit
    • M5Stack Mini Dual
    • M5StickV K210 AI Camera
    • M5Stack Glass 2 Unit
    • Hall Effect Unit
    • Voltage and Amperage Meter
    • M5Stack ENV Pro Unit
    • NCIR 2 Thermometer Unit
    • M5GO Battery Bottom2
    • M5Stack USB Module
    • M5Stack LoRa Module
    • M5Stack LLM Module
    • M5Stack Timer Power Unit
    • M5Stack 8-Encoder Unit
    • M5Stack LoRa Module
    • M5Stack 8-Angle Unit
    • Gesture recognition sensor
    • M5StickC ENV III HAT
    • M5StickC DAC 2 Hat
    • M5Stack Color Sensor
    • Time-of-Flight Distance
    • M5StickC ToF HAT
    • Neo HEX 37 RGB LED
    • M5Stamp ESP32S3
    • Tube/Air Pressure
    • 8-Channel Servo Driver
    • M5Stack Mini Angle Unit
    • M5Stack Mini Infrared Emitter
    • M5Stack NanoC6 Dev Kit
    • M5Stack ENV III Unit
    • Temperature Humidity Air Pressure
    • M5Stack 2-Channel SPST
    • M5Stack BLDC Motor
    • M5Stack Ultrasonic
    • M5Stack M5Stamp
    • M5Stack DAC
    • M5Stack Mini CAN Unit
    • M5Stack Ambient Light Sensor
    • M5Stack PIR Hat
    • M5Stack Speaker
    • M5Stack Weight
    • M5Stack Core2
    • M5StickC PLUS
    • M5Stack Barometric Pressure
    • M5Stack Ambient Light Sensor
    • M5Stack Passive Buzzer
    • M5Stack Mechanical Key Button
    • M5Stack Limit Switch
    • M5StickC Vibration HAT
    • PM5Stack RCA Audio/Video
    • M5Stack Flashlight
    • M5Stack COMMU Module Extend
    • M5Stack M5StampS3 with 1.27 Header Pin
    • M5Stack M5StampS3 with 2.54 Header Pin
    • ATOMIC Barcode/QR-Code Scanner
    • M5Stack Station ESP32 IoT
    • M5Stack ESP32 Core Ink
    • M5Paper ESP32 Development Kit
    • ATOMIC CANBus Base
    • M5Stack M5StickC ADC Hat
    • M5Stack LoRa
    • M5Stack H-bridge
    • ATOMIC GPS Base
    • M5Stack Ext Encoder
    • M5Stack Single-phase DC SSR
    • M5Stack Glass Transparent OLED
    • M5Stack Thermal Camera
    • M5Stack USB TypeC2Grove
    • M5Stack I/O Hub
    • M5Stack CardKB Mini Keyboard
    • M5Stack Red 7-Segment Digit Clock
    • M5Stack Extend I/O
    • M5Stack I2C Joystick
    • M5Stack ESP32 Ethernet
    • M5Stack 8-Channel Servo Driver
    • M5Stack Encoder
    • M5Stack MQTT PoE
    • M5Stack Ultrasonic
    • M5Stack I2C Hub
    • M5Stack MQTT
    • M5Stack Fader
    • M5Stack Real Time Clock
    • M5Stack OLED
    • M5Stack RF Unit
    • M5Stack Watering Unit
    • M5Stack Digital RGB LED
    • M5Stack JoyC Omni-directional Controller
    • M5Stack SERVO HAT
    • M5Stack Fingerprint HAT
    • M5Stack Finger Print Sensor
    • M5Stack RGB LED
    • M5Stack Mini 3A Relay
    • M5Stack Earth Moisture Sensor
    • M5Stack 1 to 3 HUB Expansion
    • M5Stack RS485 to TTL Converter
    • HEX RGB LED Board
    • M5Stack LoRa 433MHz with Antenna
    • M5Stack NB-IoT with Antenna
    • M5Stack Battery Bottom 110mAh
    • M5Stack Programmable Power Supply Module
    • M5Stack LAN Module
    • M5Stack RCA Audio/Video Module
    • M5Stack LAN Module W5500
    • M5Stack IoT Base
    • M5Stack AC Power Base
    • M5Stack GRBL Module Stepmotor Driver
    • M5Stack COM.LTE Module
    • M5Stack Proto Pegboard Module
    • M5Stack BaseX EV3 motor
    • M5Stack Proto Module
    • M5Stack M5GO/FIRE Battery
    • M5Stack PoE Camera with Wi-Fi
    • M5Stack UnitV K210 AI Camera
    • M5Stack UnitV2 M12 with Cameras
    • M5Stack ESP32 PSRAM Timer Camera Fisheye
    • M5Stack ESP32 PSRAM Timer Camera
    • M5Stack Universal IOT Experiment Kit
    • M5Stack Scale Kit
    • M5Stack AGV Mini Carkit Mecanum Wheels
    • M5Stack 6060-PUSH Linear Motion Control
    • M5Stack BugC2 w/ M5StickC PLUS2
    • M5Stack RoverC Pro
    • M5Stack BALA2 Fire Self-balancing Robot Kit
    • M5Stack 16 PCS M3 Screw
    • M5Stack Unbuckled Grove Cable
    • M5Stack RS485T T-Shaped Connector
    • M5Stack CM4Stack Development
    • M5Stack CoreS3 ESP32S3 loT Development
    • M5Stack M5StickC PLUS2 with Watch Accessories
    • M5Stack Mini GPS/BDS
    • M5Stack M5Stick T-Lite Thermal Camera
    • M5Stack UnitV2 - The standalone AI Camera
    • M5Stack ESP32 Fisheye Camera
    • M5Stack Voltage and Amperage Meter
    • M5Stack CardKB Mini Keyboard
    • M5Stack M5Stamp C3 (5pcs)
  • 2️⃣ESP
    • ESP8266EX
    • ESP8266 ESP-01S WiFi module
    • ESP32-WROOM-32E
    • ESP32-WROOM-32 Wifi Bluetooth Type-C Dev Kit
    • ESP32-S3-WROOM-1U
    • ESP32-S3-Nano - Development Board
    • ESP32-S3 Rotary Switch LCD 2.1 inch Round LCD Screen
    • ESP32-PICO-D4
    • ESP32-H2
    • ESP32-CAM Camera Module
    • ESP32-C6
    • ESP32 NODEMCU Module WiFi Development Board with CP2102
    • ESP32 D1 Mini Nodemcu Development Board
    • D1 Mini Nodemcu with ESP8266-12F WLAN module
    • D1 Mini V3 Nodemcu with ESP8266-12F WLAN module
    • Seeed Studio XIAO ESP32S3 WIFI Dev Board
    • XIAO SAMD21 Arduino Microcontroller
    • XIAO RP2040
    • XIAO ESP32-C3 WIFI
    • XIAO ESP32-C6 WIFI
    • 6x10 RGB MATRIX
    • XIAO nRF52840 Sense
  • 3️⃣DRONE / FPV
    • ZD850 850mm Compact Folding Hexacopter Drone Frame Kit Full Carbon Fiber
    • DXW 4114 400KV High Power Brushless Motors
    • DXW D4250 800KV 3-7S Brushless Motor
    • DXW D3536 1200KV 2-4S Brushless Motor
    • DXW A2212/C2826 3.17mm Outrunner Brushless Motor
    • Hobbywing Skywalker V2 Brushless ESC Speed Controller
    • Pixhawk PX4 Flight Controller
    • Holybro Pixhawk 6C
    • GPS Stand
    • Holybro GPS M8N
    • Holybro GPS M9N
    • Holybro GPS M10N
    • Radiolink M8N SE100 GPS Module
    • Radiolink M10N SE100 GPS for PX4/Pixhawk 2.4.8
    • Mateksys GNSS M9N-5883
    • MFD Crosshair Color OSD
    • 2 Pair Carbon Fiber CW CCW Propellers
    • 3-Axis Brushless Gimbal Frame With Motors & Storm32 Controller
    • 2-Axis Brushless Gimbal Frame With Motors & Storm32 Controller
    • RadioLink AT10 II 2.4Ghz 10CH RC Transmitter
    • Radiolink Mini PIX V1.2 Flight Controller M10N GPS TS100 SE100 (Pixhawk Alternative)
    • 2Pcs OVONIC 3S 4S 6S Lipo Battery For RC FPV
    • Gens ACE Lipo Battery with T/XT60 Plug
    • LiPo Battery 3S 11.1V for RC Drone
    • Holybro PM02 V3 Power Module 12S
    • Holybro PM06 V2 Power Module 14S
    • Holybro PM07 V2 Power Module 14S
    • Holybro Power Distribution Board (PDB)
    • Mateksys Power Distribution Board (PDB) XT60 W/ BEC 5V & 12V
    • Hawk eye FPV Monitor 5.8G 48CH 4.3 inch FPV HD Monito
    • RUSH TANK MAX SOLO 5.8GHz 2.5W High Power 48CH VTX Video Transmitter
    • RUSH TANK SOLO 5.8G VTX Video Transmitter CNC shell 1.6W
    • Happymodel EP1 Dual Receiver 2.4Ghz ExpressLRS RX
    • Mateksys BEC12S-PRO, 9-55V TO 5V/8V/12V-5A
    • ZD850 850mm 6-axis Drone with 6kg Payload
    • ZD550 550mm 4-axis Drone with 6kg Payload
    • YRRC 5.8G 2.5W 40CH VTX Drone FPV Analog Image Transmission
    • Hawkeye Firefly 8SE/8S 4K Screen WiFi FPV Action Camera
  • 4️⃣RASPBEERY PI
    • Raspberry Pi Pico W Wireless RP2040 MCU Board
    • Raspberry Pi 5
    • Raspberry Pi 4B
    • ELAB Raspberry Pi Card Reader
    • ELAB Raspberry Pi 5 Active Cooler
    • ELAB Raspberry Pi 4/5 Case (Acrylic case)
    • ELAB Raspberry Pi 4 Heat Sink (Copper)
    • Camera for Raspberry Pi
    • XIAO RP2350 Onboard RGB LED, Arm Cortex-M33 and Hazard3 RISC-V(Pre-Order)
    • Raspberry Pi Pico 2 RP2350
    • Seeed Studio Grove Starter Kit for LinkIt ONE
    • Seeed Studio ReSpeaker USB Mic Array
    • Raspberry Pi Zero 2W with Bluetooth 4.2 Onboard Antenna
    • Raspberry Pi Zero WH WiFi/Bluetooth 4.1 Bluetooth Low Energy
    • Seeed Studio XIAO RP2040 Supports Arduino
    • M.2 HAT for Raspberry Pi 5
    • EdgeBox Raspberry Pi IoT Edge Device 4GB RAM 32GB eMMC WiFi
    • Raspberry Pi Compute Module 4 with WiFi
    • Raspberry Pi 4 ReSpeaker Intelligent Speech Recognition 2 Microphone
    • Raspberry Pi 5 Vision Car AI Development Board Camera Recognition WIFI Kit
    • Waveshare RM500U-CNV Raspberry PI 5G/4G/3G Hat
    • Hailo-8 M.2 AI Accelerator Module Suitable for Raspberry Pi 5
    • Waveshare ESP8266 for Raspberry Pi Pico Wifi Module TCP UDP
    • Waveshare MAX-M8Q GNSS HAT for Raspberry Pi
    • Waveshare SX1262 LoRa HAT for Raspberry UART
    • Waveshare SX1268 LoRa HAT for Raspberry UART
    • Waveshare SIM7070G NB-IoT / Cat-M / GPRS / GNSS HAT for Raspberry Pi
    • Waveshare SIM7600G-H M.2 4G HAT for Raspberry Pi 4G/3G/2G GNSS
    • Waveshare SIM7600CE-CNSE 4G HAT for Raspberry Pi 4G 3G 2G GNSS
  • 5️⃣ARDUINO
    • ATmega328DIP Board Microcontroller Board
    • OpenELAB EASY PLUG RGB TCS34725 Color Sensor Module I2C
    • OpenELAB EASY PLUG Micro SD TFT card Read and Write Module
    • OpenELAB EASY PLUG CCS811 CO2 Air Quality Sensor
    • OpenELAB EASY PLUG SR01 Ultrasonic Sensor
    • OpenELAB EASY PLUG Education Robot Car Kit
    • OpenELAB EASY PLUG Sensor Learning Kit for Arduino
    • OpenELAB EASY PLUG Ultimate Starter Kit for Arduino
    • OpenELAB KEYBOT Programmable Education Robot Control Board
    • OpenELAB RJ11 EASY Plug Main Control Upgrade Board V2.0
    • OpenELAB Desktop Mini Bluetooth Smart Robot Car Kit V3.0
    • OpenELAB 4WD Mechanical Arm Robot Smart Car for Arduino
    • OpenELAB 4DOF Mechanical Arm Robot Car Learning Starter Kit
    • OpenELAB 4WD Mechanical Arm Robot Smart Car for Arduino
    • OpenELAB Desktop Mini Bluetooth Smart Robot Car Kit V3.0
    • OpenELAB RJ11 EASY Plug Main Control Upgrade Board V2.0
    • OpenELAB KEYBOT Programmable Education Robot Control Board
    • OpenELAB EASY PLUG Ultimate Starter Kit for Arduino
  • 6️⃣DISPLAYS
    • 1.3 inch OLED I2C 128 x 64 Pixel Display
    • 0.91 inch OLED I2C Display 128 x 32 pixels
    • WT32S3-86S touch display screen with temp and humidity sensor
    • LCD Display 1602 I2C
    • HW-140 DC-DC Buck Boost Converter Step Up/Down, LCD display
    • HD44780 2004 LCD Display Bundle 4x20 characters
    • ESP32-S3 Rotary Switch LCD 2.1 inch Round LCD Screen
    • 8*8 Matrix LED Display Module
    • 4 digit 7-segment LED Display
    • 3.5-inch 320x480 resistive touch display
    • 3.5-inch 320x480 capacitive touch display
    • 1.77 inch Spi TFT Display and 128x160 Pixels
    • 1.8 inch Spi TFT Display 128 x 160 pixels
    • 1 Digit 7-Segment LED Display 1 inch 25.4 mm
    • 0.96 inch OLED SSD1306 Display I2C 128 x 64 pixels
    • Waveshare 10.1 inch IPS Capacitive Touch Display
    • Waveshare 10.1 inch QLED Touch Display
    • Waveshare 9.7 inch IPS Capacitive Touch Display
    • Waveshare 10.1 inch IPS Capacitive Touch LCD
    • Waveshare 9.3 inch LCD Capacitive Touch Display High Brightness
    • Waveshare 9 inch QLED Quantum Dot Display
    • Waveshare 8 inch 2K IPS Capacitive Touch Display
    • Waveshare 8DP-CAPLCD 8 inch Capacitive Touch Display
    • Waveshare 7.9 inch IPS LCD Touch Screen, 400×1280 HDMI
    • Waveshare 8 inch DSI LCD Display Touch Screen I2C
    • Waveshare 7 inch IPS Integrated Display, With Touch Function
    • Waveshare 7HP-CAPQLED 7 inch QLED Quantum Dot Display
    • Waveshare 7 inch Capacitive Touch Screen HDMI
    • Waveshare 7 inch Capacitive Touch Screen with Case HDMI
    • 2.8inch USB Monitor,Water Cooler Screen/ PC Case Secondary Screen
    • Waveshare 5inch Desktop RGB Ambient Screen
    • Waveshare 5inch IPS Round Touch DisplayHDMI
    • Waveshare 5.5inch 2K Touch LCD Display HDMI
    • 2.1 inch USB Monitor, Water Cooler Screen/ PC Case Secondary Screen
    • Waveshare 8.8inch Desktop RGB Ambient Screen Type-C
    • Waveshare 8inch Desktop RGB Ambient Screen Type-C
    • Waveshare 7 inch Desktop RGB Ambient Screen
    • Waveshare 5inch HDMI Touch Screen LCD with Bicolor Case
    • Waveshare 65K RGB General 1.28inch Round LCD Display Module
    • 0.96 inch OLED Display Module, SPI / I2C Communication
    • 1.5 inch LCD Display Module, IPS Panel SPI 262K colors
    • Waveshare 1.8inch colorful display module for micro:bit
    • Waveshare 3.5inch RPi LCD (A)
    • Waveshare 5 inch LCD Touch Screen Display for Raspberry Pi
    • Waveshare 1.47inch LCD Display Module SPI
    • 7.3 inch 7 Color E-Paper
    • Waveshare 15.6 inch QLED Touch
    • Waveshare 7.5 inch NFC-Powered
  • 7️⃣CAMERAS
    • OV5640 Camera Board (A), 5 Megapixel (2592x1944)
    • OV2640 Camera Board (1622x1200)
    • Hawkeye Firefly 8SE/8S 4K Screen WiFi FPV Action Camera
    • ESP32-CAM Camera Module
    • DFRobot Gravity Huskylens AI Camera
    • IMX335 5MP USB Camera (B)
  • 8️⃣SENSORS
    • Rotation Sensor
    • WT32S3-86S touch display screen with temp and humidity sensor
    • Vibration Sensor
    • Ultrasonic Sensor
    • Thermistor Module
    • Soil Temperature and Humidity Module
    • Soil Moisture Sensor Hygrometer Module V1.2 capacitive
    • Shock Sensor Module
    • MQ-135 Gas Sensor
    • Motion Sensor Motion Detection Module HC-SR501 PIR
    • DHT11 Temperature-Humidity Sensor
    • DHT22 AM2302 Temperature sensor and humidity sensor
    • Current Sensor ACS712ELC-20A
    • VL53L0X Time-of-Flight (TOF) Laser distance sensor
    • GY-521 MPU-6050 3-axis gyroscope and acceleration sensor
    • DS18B20 digital temperature sensor
    • BME280 Humidity Pressure Temperature Sensors
  • 9️⃣IOT / COMMUNICATION
    • NodeMCU Lua Amica Module V2 ESP8266 ESP-12F WIFI
    • SIM7028 NB-IoT HAT
    • NRF24L01 with 2.4 GHz
    • Ai-Thinker AiPi-Eyes-S1 WifFi Camera
    • Ai-Thinker AiPi-Eyes-S2 WifFi Camera
  • 🔟MOTORS
    • CyberGear micromotor instruction manual
    • Servo Motor (SG90)
    • 5V DC Stepper Motor & ULN2003 Driver Board
    • 130 DC Motor
    • Xiaomi CyberGear Micromotor
  • 🇰🇳KITS
    • mBot Mega
  • ⚡POWER
    • HW-140 DC-DC Buck Boost Converter Step Up/Down, LCD display
    • MT3608 DC-DC power supply adapter step up module
    • LM2596S Step-down DC-DC Buck Converter
    • LM2596S DC-DC power supply adapter step down module
    • Hi-Link DC-DC 5V to xxV 1W Mini Converter Isolated Power Supply
    • Hi-Link AC-DC 5W Converter Power Supply
    • Hi-Link AC-DC 220V to xxV 3W Converter Power Supply
    • SunLit Austa Solar Module
  • 🔌ACCESSORIES
    • 4 digit 7-segment LED Display
    • 5V LED Traffic Signal Module
    • LED Ring 5V RGB WS2812B 12-Bit 50mm
    • 3D MKS Gen V1.4 Printer
    • USB 3.2 To 5GbE Adapter (WP-UT5) Realtek RTL8157
  • Heygears Reflex User Guide
Powered by GitBook
On this page
  • Waveshare 65K RGB General 1.28inch Round LCD Display Module
  • Product Link
  • Introduction
  • Specification
  • Interface Description
  • Working with Raspberry Pi
  • Install Library
  • Download Examples
  • Run the demo codes
  • API Description
  • Using with STM32
  • Program Description
  • Arduino Software Description
  • Program Description
  • VisionFive2
  • Resources
  • FAQ

Was this helpful?

PreviousWaveshare 5inch HDMI Touch Screen LCD with Bicolor CaseNext0.96 inch OLED Display Module, SPI / I2C Communication

Last updated 9 months ago

Was this helpful?

Waveshare 65K RGB General 1.28inch Round LCD Display Module


Product Link

Introduction

1.28inch LCD Display Module, IPS Screen, 65K RGB, 240 × 240 Resolution, SPI Interface.

Specification

  • Operating voltage: 3.3V/5V

  • Interface: SPI

  • LCD type: IPS

  • Controller: GC9A01

  • Resolution: 240 (H)RGB x 240(V)

  • Display size: Φ32.4mm

  • Pixel size: 0.135(H)x 0.135(V)mm

  • Dimension: 40.4 × 37.5(mm) Φ37.5(mm)

Interface Description

Raspberry Pi

Please connect the LCD to your Raspberry Pi by the 8PIN cable according to the table below Use the pin header or PH2.0 8PIN interface, you need to connect according to the following table

LCD
Raspberry Pi

BCM2835

Board

VCC

3.3V

3.3V

GND

GND

GND

DIN

MOSI

19

CLK

SCLK

23

CS

CE0

24

DS

25

22

RST

27

13

BL

18

12

The 1.28inch LCD uses the PH2.0 8PIN interface, which can be connected to the Raspberry Pi according to the above table: (Please connect according to the pin definition table. The color of the wiring in the picture is for reference only, and the actual color shall prevail.)

STM32

The example we provide is based on STM32F103RBT6, and the connection method provided is also the corresponding pin of STM32F103RBT6. If you need to transplant the program, please connect according to the actual pin.

LCD
STM32

VCC

3.3V

GND

GND

DIN

PA7

CLK

PA5

CS

PB6

DC

PA8

RST

PA9

BL

PC7

Arduino

LCD
UNO

VCC

5V

GND

GND

DIN

D11

CLK

D13

CS

D10

DC

D7

RST

D8

BL

D9

The connection diagram is as follows (click to enlarge):

LCD & Controller

The built-in driver used in this LCD is GC9A01, with a resolution of 240RGB×240 dots, 129,600 bytes of GRAM inside. This LCD supports 12/16/18-bit data bus MCU interface, namely the formats of RGB444, RGB565, RGB666, which are commonly used. Most of the LCD controllers can debug their communication ways such as by 8080 parallel interfaces, three-wire SPI, four-wire SPI, and so on. This LCD adopts a four-wire SPI communication interface, which can greatly save the GPIO port, and the communication speed will be faster.

  • Maybe you have doubts that as the screen is circular, which point is the first pixel? How to determine the coordinates?

    • In fact, you can presume that a square screen draws an inscribed circle in it. We only display the content in this inscribed circle, and the pixels beside the square are deleted. The same is true for most of the circular LCDs on the market.

Communication Protocol

Note: Different from the traditional SPI protocol: the data line sent from the slave to the host is hidden as the LCD only needs to be displayed. Please refer to the table on Datasheet Page 105. RESX: reset, it is pulled low when the module is powered on, and it is usually set to 1. CSX: the slave chip selection and the chip will be enabled only when CS is low. D/CX: the data/command control pin of the chip, write command when DC = 0, write data when DC=1 SDA: the transmitted data, that is, RGB data; SCL: the SPI communication clock. For SPI communication, data is transmitted with timing, that is, the combination of clock phase (CPHA) and clock polarity (CPOL): The level of CPHA determines whether the data of the serial synchronization clock is collected on the first clock transition edge or the second clock transition edge. When CPHA = 0, data acquisition is performed on the first transition edge; The level of CPOL determines the idle state level of the serial synchronous clock. CPOL = 0, which is a low level. As can be seen from the figure, when the first falling edge of SCLK starts to transmit data, 8bit data is transmitted in one clock cycle, using SPI0, bit-by-bit transmission, high-order first, and low-order at last.

Working with Raspberry Pi

Enable SPI interface

PS: If you are using the system of the Bullseye branch, you need to change "apt-get" to "apt", the system of the Bullseye branch only supports Python3.

  • Open terminal, use command to enter the configuration page

sudo raspi-config
Choose Interfacing Options -> SPI -> Yes  to enable SPI interface

Reboot Raspberry Pi:

sudo reboot

Please make sure the SPI is not occupied by other devices, you can check in the middle of /boot/config.txt

Install Library

If you use bookworm system, only the lgpio library is available, bcm2835 and wiringPi libarary cannot be installed or used. Please note that the python library does not need to install, you can directly run the demo.

BCM2835

#Open the Raspberry Pi terminal and run the following command
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
tar zxvf bcm2835-1.71.tar.gz 
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
# For more, you can refer to the official website at: http://www.airspayce.com/mikem/bcm2835/

WiringPi

#Open the Raspberry Pi terminal and run the following command
cd
sudo apt-get install wiringpi
#For Raspberry Pi systems after May 2019 (earlier than that can be executed without), an upgrade may be required:
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
# Run gpio -v and version 2.52 will appear, if it doesn't it means there was an installation error

# Bullseye branch system using the following command:
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
. /build
gpio -v
# Run gpio -v and version 2.70 will appear, if it doesn't it means there was an installation error

lgpio

#Open the Raspberry Pi terminal and run the following command
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install
#Raspberry Pi 5 
sudo apt install python3-rpi-lgpio
#For more details, you can refer to https://github.com/gpiozero/lg

Python

sudo apt-get update
sudo apt-get install python3-pip
sudo apt-get install python3-pil
sudo apt-get install python3-numpy
sudo pip3 install spidev

Download Examples

Open Raspberry Pi terminal and run the following command

sudo apt-get install unzip -y
sudo wget https://files.waveshare.com/upload/8/8d/LCD_Module_RPI_code.zip
sudo unzip ./LCD_Module_RPI_code.zip 
cd LCD_Module_RPI_code/RaspberryPi/

Run the demo codes

Please go into the RaspberryPi directory (demo codes) first and run the commands in terminal

C codes

  • Re-compile the demo codes

cd c
sudo make clean
sudo make -j 8
  • The test program of all screens can be called directly by entering the corresponding size

sudo ./main Screen Size

Depending on the LCD, one of the following commands should be entered:

#0.96inch LCD Module
sudo ./main 0.96
#1.14inch LCD Module
sudo ./main 1.14
#1.28inch LCD Module
sudo ./main 1.28
#1.3inch LCD Module
sudo ./main 1.3
#1.47inch LCD Module
sudo ./main 1.47
#1.54inch LCD Module
sudo ./main 1.54
#1.8inch LCD Module
sudo ./main 1.8
#2inch LCD Module
sudo ./main 2
#2.4inch LCD Module
sudo ./main 2.4

python

  • Enter the python program directory and run the command ls -l

cd python/examples
ls -l
  • Just run the program corresponding to the screen, the program supports python2/3

# python2
sudo python 0inch96_LCD_test.py
sudo python 1inch14_LCD_test.py
sudo python 1inch28_LCD_test.py
sudo python 1inch3_LCD_test.py
sudo python 1inch47_LCD_test.py
sudo python 1inch54_LCD_test.py
sudo python 1inch8_LCD_test.py
sudo python 2inch_LCD_test.py
sudo python 2inch4_LCD_test.py
# python3
sudo python3 0inch96_LCD_test.py
sudo python3 1inch14_LCD_test.py
sudo python3 1inch28_LCD_test.py
sudo python3 1inch3_LCD_test.py
sudo python3 1inch47_LCD_test.py
sudo python3 1inch54_LCD_test.py
sudo python3 1inch8_LCD_test.py
sudo python3 2inch_LCD_test.py
sudo python3 2inch4_LCD_test.py

API Description

The RaspberryPi series can share a set of programs, because they are all embedded systems, and the compatibility is relatively strong. The program is divided into bottom-layer hardware interface, middle-layer LCD screen driver, and upper-layer application;

C

Hardware Interface

We have carried out the low-level encapsulation, if you need to know the internal implementation can go to the corresponding directory to check, for the reason the hardware platform and the internal implementation are different. You can open DEV_Config.c(.h) to see definitions,which in the directory RaspberryPi\c\lib\Config.

1. There are three ways for C to drive: BCM2835 library, WiringPi library, and Dev library respectively
2. We use Dev libraries by default. If you need to change to BCM2835 or WiringPi libraries, please open RaspberryPi\c\Makefile and modify lines 13-15 as follows:  
  • Data type:

#define UBYTE      uint8_t
#define UWORD      uint16_t
#define UDOUBLE    uint32_t
  • Module initialization and exit processing.

void DEV_Module_Init(void);
void DEV_Module_Exit(void);
Note: 
  Here is some GPIO processing before and after using the LCD screen.
  • GPIO read and write:

void 	DEV_Digital_Write(UWORD Pin, UBYTE Value);
UBYTE 	DEV_Digital_Read(UWORD Pin);
  • SPI write data:

void DEV_SPI_WriteByte(UBYTE Value);

Upper application

If you need to draw pictures or display Chinese and English characters, we provide some basic functions here about some graphics processing in the directory RaspberryPi\c\lib\GUI\GUI_Paint.c(.h).

The fonts can be found in RaspberryPi\c\lib\Fonts directory.

  • New Image Properties: Create a new image buffer, this property includes the image buffer name, width, height, flip Angle, and color.

void Paint_NewImage(UBYTE *image, UWORD Width, UWORD Height, UWORD Rotate, UWORD Color)
Parameters:
      Image: the name of the image buffer, which is actually a pointer to the first address of the image buffer;
      Width: image buffer Width;
      Height: the Height of the image buffer;
      Rotate: Indicates the rotation Angle of an image
      Color: the initial Color of the image;
  • Select image buffer: The purpose of the selection is that you can create multiple image attributes, there can be multiple images buffer, you can select each image you create.

void Paint_SelectImage(UBYTE *image)
Parameters:
       Image: the name of the image buffer, which is actually a pointer to the first address of the image buffer;
  • Image Rotation: Set the rotation Angle of the selected image, preferably after Paint_SelectImage(), you can choose to rotate 0, 90, 180, 270.

void Paint_SetRotate(UWORD Rotate)
Parameters:
        Rotate: ROTATE_0, ROTATE_90, ROTATE_180, and ROTATE_270 correspond to 0, 90, 180, and 270 degrees.
  • Image mirror flip: Set the mirror flip of the selected image. You can choose no mirror, horizontal mirror, vertical mirror, or image center mirror

void Paint_SetMirroring(UBYTE mirror)
Parameters:
        Mirror: indicates the image mirroring mode. MIRROR_NONE, MIRROR_HORIZONTAL, MIRROR_VERTICAL, MIRROR_ORIGIN correspond to no mirror, horizontal mirror, vertical mirror, and image center mirror respectively.
  • Set points of the display position and color in the buffer: here is the core GUI function, processing points display position and color in the buffer.

void Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color)
Parameters:
        Xpoint: the X position of a point in the image buffer
        Ypoint: Y position of a point in the image buffer
        Color: indicates the Color of the dot
  • Image buffer fill color: Fills the image buffer with a color, usually used to flash the screen into blank.

void Paint_Clear(UWORD Color)
Parameters:
        Color: fill Color
  • The fill color of a certain window in the image buffer: the image buffer part of the window filled with a certain color, usually used to fresh the screen into blank, often used for time display, fresh the last second of the screen.

void Paint_ClearWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color)
Parameters:
        Xstart: the x-starting coordinate of the window
        Ystart: the y-starting coordinate of the window
        Xend: the x-end coordinate of the window
        Yend: the y-end coordinate of the window
        Color: fill Color
  • Draw point: In the image buffer, draw points on (Xpoint, Ypoint), you can choose the color, the size of the point, the style of the point.

void Paint_DrawPoint(UWORD Xpoint, UWORD Ypoint, UWORD Color, DOT_PIXEL Dot_Pixel, DOT_STYLE Dot_Style)
Parameters:
        Xpoint: indicates the X coordinate of a point.
        Ypoint: indicates the Y coordinate of a point.
        Color: fill Color
        Dot_Pixel: The size of the dot, the demo provides 8 size pointss by default.
              typedef enum {
                 DOT_PIXEL_1X1  = 1,	// 1 x 1
                 DOT_PIXEL_2X2  , 		// 2 X 2
                 DOT_PIXEL_3X3  , 	 	// 3 X 3
                 DOT_PIXEL_4X4  , 	 	// 4 X 4
                 DOT_PIXEL_5X5  , 		// 5 X 5
                 DOT_PIXEL_6X6  , 		// 6 X 6
                 DOT_PIXEL_7X7  , 		// 7 X 7
                 DOT_PIXEL_8X8  , 		// 8 X 8
               } DOT_PIXEL;
        Dot_Style: the size of a point that expands from the center of the point or from the bottom left corner of the point to the right and up.
                 typedef enum {
                     DOT_FILL_AROUND  = 1,
                     DOT_FILL_RIGHTUP,
                  } DOT_STYLE;
  • Draw line: In the image buffer, draw line from (Xstart, Ystart) to (Xend, Yend), you can choose the color, the width and the style of the line.

void Paint_DrawLine(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, LINE_STYLE Line_Style ,  LINE_STYLE Line_Style)
Parameters:
        Xstart: the x-starting coordinate of a line
        Ystart: the y-starting coordinate of the a line
        Xend: the x-end coordinate of a line
        Yend: the y-end coordinate of a line
        Color: fill Color
        Line_width: The width of the line, the demo provides 8 sizes of width by default.
              typedef enum {
                 DOT_PIXEL_1X1  = 1,	// 1 x 1
                 DOT_PIXEL_2X2  , 		// 2 X 2
                 DOT_PIXEL_3X3  ,		// 3 X 3
                 DOT_PIXEL_4X4  ,		// 4 X 4
                 DOT_PIXEL_5X5  , 		// 5 X 5
                 DOT_PIXEL_6X6  , 		// 6 X 6
                 DOT_PIXEL_7X7  , 		// 7 X 7
                 DOT_PIXEL_8X8  , 		// 8 X 8
              } DOT_PIXEL;
        Line_Style: line style. Select whether the lines are joined in a straight or dashed way.
              typedef enum {
                 LINE_STYLE_SOLID = 0,
                 LINE_STYLE_DOTTED,
              } LINE_STYLE;
  • Draw rectangle: In the image buffer, draw a rectangle from (Xstart, Ystart) to (Xend, Yend), you can choose the color, the width of the line, whether to fill the inside of the rectangle.

void Paint_DrawRectangle(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, DOT_PIXEL Line_width,  DRAW_FILL Draw_Fill)
Parameters:
	Xstart: the starting X coordinate of the rectangle
	Ystart: the starting Y coordinate of the rectangle
	Xend: the x-end coordinate of the rectangle
        Yend: the y-end coordinate of the rectangle
	Color: fill Color
	Line_width: The width of the four sides of a rectangle. And the demo provides 8 sizes of width by default.
		typedef enum {
			DOT_PIXEL_1X1  = 1,	// 1 x 1
			DOT_PIXEL_2X2  , 		// 2 X 2
			DOT_PIXEL_3X3  ,		// 3 X 3
			DOT_PIXEL_4X4  ,	        // 4 X 4
			DOT_PIXEL_5X5  , 		// 5 X 5
 			DOT_PIXEL_6X6  , 		// 6 X 6
                        DOT_PIXEL_7X7  , 		// 7 X 7
                        DOT_PIXEL_8X8  , 		// 8 X 8
                 } DOT_PIXEL;
         Draw_Fill: Fill, whether to fill the inside of the rectangle
              typedef enum {
                 	DRAW_FILL_EMPTY = 0,
                 	DRAW_FILL_FULL,
              } DRAW_FILL;
  • Draw circle: In the image buffer, draw a circle of Radius with (X_Center Y_Center) as the center. You can choose the color, the width of the line, and whether to fill the inside of the circle.

void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius, UWORD Color, DOT_PIXEL Line_width,  DRAW_FILL Draw_Fill)
Parameters:
	X_Center: the x-coordinate of the center of the circle
	Y_Center: the y-coordinate of the center of the circle
	Radius: indicates the Radius of a circle
	Color: fill Color
	Line_width: The width of the arc, with a default of 8 widths
		typedef enum {
        		DOT_PIXEL_1X1  = 1,	// 1 x 1
        		DOT_PIXEL_2X2  , 		// 2 X 2
        		DOT_PIXEL_3X3  ,		// 3 X 3
        		DOT_PIXEL_4X4  ,		// 4 X 4
        		DOT_PIXEL_5X5  , 		// 5 X 5
        		DOT_PIXEL_6X6  , 		// 6 X 6
        		DOT_PIXEL_7X7  , 		// 7 X 7
        		DOT_PIXEL_8X8  , 		// 8 X 8
		} DOT_PIXEL;
	Draw_Fill: fill, whether to fill the inside of the circle
              typedef enum {
              		DRAW_FILL_EMPTY = 0,
                 	DRAW_FILL_FULL,
              } DRAW_FILL;
  • Write Ascii character: In the image buffer, use (Xstart Ystart) as the left vertex, write an Ascii character, you can select Ascii visual character library, font foreground color, font background color.

void Paint_DrawChar(UWORD Xstart, UWORD Ystart, const char Ascii_Char, sFONT* Font, UWORD Color_Foreground,  UWORD Color_Background)
Parameters:
	Xstart: the x-coordinate of the left vertex of a character
	Ystart: the Y-coordinate of the left vertex of a character
	Ascii_Char: indicates the Ascii character
	Font: Ascii visual character library, in the Fonts folder the demo provides the following Fonts:
  		Font8: 5*8 font
    		Font12: 7*12 font
    		Font16: 11*16 font
    		Font20: 14*20 font
    		Font24: 17*24 font
  	Color_Foreground: Font color
  	Color_Background: indicates the background color
  • Write English string: In the image buffer, use (Xstart Ystart) as the left vertex, write a string of English characters, you can choose Ascii visual character library, font foreground color, font background color.

void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground,  UWORD Color_Background)
Parameters:
	Xstart: the x-coordinate of the left vertex of a character
	Ystart: the Y coordinate of the font's left vertex
	PString: string, string is a pointer
	Font: Ascii visual character library, in the Fonts folder the demo provides the following Fonts:
     		Font8: 5*8 font
     		Font12: 7*12 font
     		Font16: 11*16 font
     		Font20: 14*20 font
     		Font24: 17*24 font
	Color_Foreground: Font color
  	Color_Background: indicates the background color
  • Write Chinese string: in the image buffer, use (Xstart Ystart) as the left vertex, write a string of Chinese characters, you can choose character font, font foreground color, and font background color of the GB2312 encoding.

void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font, UWORD Color_Foreground,  UWORD Color_Background)
Parameters:
	Xstart: the x-coordinate of the left vertex of a character
	Ystart: the Y coordinate of the font's left vertex
	PString: string, string is a pointer
  	Font: GB2312 encoding character Font library, in the Fonts folder the demo provides the following Fonts:
     		Font12CN: ASCII font 11*21, Chinese font 16*21
     		Font24CN: ASCII font24 *41, Chinese font 32*41
	Color_Foreground: Font color
	Color_Background: indicates the background color
  • Write numbers: In the image buffer,use (Xstart Ystart) as the left vertex, write a string of numbers, you can choose Ascii visual character library, font foreground color, font background color.

void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, double Nummber, sFONT* Font, UWORD Digit, UWORD Color_Foreground,   UWORD Color_Background)
Parameters:
	Xpoint: the x-coordinate of the left vertex of a character
	Ypoint: the Y coordinate of the left vertex of the font
	Nummber: indicates the number displayed, which can be a decimal
	Digit: It's a decimal number
 	Font: Ascii visual character library, in the Fonts folder the demo provides the following Fonts:
   		Font8: 5*8 font
   		Font12: 7*12 font
   		Font16: 11*16 font
		Font20: 14*20 font
   		Font24: 17*24 font
	Color_Foreground: Font color
	Color_Background: indicates the background color
  • Display time: in the image buffer,use (Xstart Ystart) as the left vertex, display time,you can choose Ascii visual character font, font foreground color, font background color.

void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, UWORD Color_Background,  UWORD Color_Foreground)
Parameters:
	Xstart: the x-coordinate of the left vertex of a character
 	Ystart: the Y coordinate of the font's left vertex
	PTime: display time, A time structure is defined here, as long as the hours, minutes, and seconds are passed to the parameters;
	Font: Ascii visual character library, in the Fonts folder the demo provides the following Fonts:
     		Font8: 5*8 font
     		Font12: 7*12 font
     		Font16: 11*16 font
     		Font20: 14*20 font
     		Font24: 17*24 font
  	Color_Foreground: Font color
  	Color_Background: indicates the background color
  • Read the local bmp image and write it to the cache.

For Linux operating systems such as Raspberry Pi, you can read and write pictures. For Raspberry Pi, in the directory: RaspberryPi\c\lib\GUI\GUI_BMPfile.c(.h).

UBYTE GUI_ReadBmp(const char *path, UWORD Xstart, UWORD Ystart)
parameter:
       path: the relative path of the BMP image
       Xstart: The X coordinate of the left vertex of the image, generally 0 is passed by default
       Ystart: The Y coordinate of the left vertex of the picture, generally 0 by default

Testing Code for Users

For Raspberry Pi, in the directory: RaspberryPi\c\examples, for all the test code;

If you need to run the 0.96-inch LCD test program, you need to add 0.96 as a parameter when running the main demo. Re-execute in Linux command mode as follows:

make clean
make
sudo ./main 0.96

Python (for Raspberry Pi)

Works with python and python3. For python, his calls are not as complicated as C. Raspberry Pi: RaspberryPi\python\lib\

lcdconfig.py

  • Module initialization and exit processing.

def module_init()
def module_exit()
Note:
1. Here is some GPIO processing before and after using the LCD screen.
2. The module_init() function is automatically called in the INIT () initializer on the LCD, but the module_exit() function needs to be called by itself.
  • GPIO read and write:

def  digital_write(pin, value)
def  digital_read(pin)
  • SPI write data.

def spi_writebyte(data)
  • xxx_LCD_test.py (xxx indicates the size, if it is a 0.96inch LCD, it is 0inch96_LCD_test.py, and so on)

python is in the following directory: Raspberry Pi: RaspberryPi\python\examples\

If your python version is python2 and you need to run the 0.96inch LCD test program, re-execute it as follows in linux command mode:

sudo python 0inch96_LCD_test.py

If your python version is python3 and you need to run the 0.96inch LCD test program, re-execute the following in linux command mode:

sudo python3 0inch96_LCD_test.py

About Rotation Settings

If you need to set the screen rotation in the python program, you can set it by the statement im_r= image1.rotate(270).

im_r= image1.rotate(270)

Rotation effect, take 1.54 as an example, the order is 0°, 90°, 180°, 270°

GUI Functions

  • It needs to use the image library and install the library.

sudo apt-get install python3-pil  

And then import the library

from PIL import Image,ImageDraw,ImageFont.

Among them, Image is the basic library, ImageDraw is the drawing function, and ImageFont is the text function.

  • Define an image cache to facilitate drawing, writing, and other functions on the picture.

image1 = Image.new("RGB", (disp.width, disp.height), "WHITE")

The first parameter defines the color depth of the image, which is defined as "1" to indicate the bitmap of one-bit depth. The second parameter is a tuple that defines the width and height of the image. The third parameter defines the default color of the buffer, which is defined as "WHITE".

  • Create a drawing object based on Image1 on which all drawing operations will be performed on here.

draw = ImageDraw.Draw(image1)
  • Draw a line.

draw.line([(20, 10),(70, 60)], fill = "RED",width = 1)

The first parameter is a four-element tuple starting at (0, 0) and ending at (127,0). Draw a line. Fill ="0" means the color of the line is white.

  • Draw a rectangle.

draw.rectangle([(20,10),(70,60)],fill = "WHITE",outline="BLACK")

The first argument is a tuple of four elements. (20,10) is the coordinate value in the upper left corner of the rectangle, and (70,60) is the coordinate value in the lower right corner of the rectangle. Fill =" WHITE" means BLACK inside, and outline="BLACK" means the color of the outline is black.

  • Draw a circle.

draw.arc((150,15,190,55),0, 360, fill =(0,255,0)

Draw an inscribed circle in the square, the first parameter is a tuple of 4 elements, with (150, 15) as the upper left corner vertex of the square, (190, 55) as the lower right corner vertex of the square, specifying the level median line of the rectangular frame is the angle of 0 degrees, the second parameter indicates the starting angle, the third parameter indicates the ending angle, and fill = 0 indicates that the color of the line is white. If the figure is not square according to the coordination, you will get an ellipse.

Besides the arc function, you can also use the chord function for drawing a solid circle.

draw.ellipse((150,65,190,105), fill = 0)

The first parameter is the coordination of the enclosing rectangle. The second and third parameters are the beginning and end degrees of the circle. The fourth parameter is the fill color of the circle.

  • Character.

The ImageFont module needs to be imported and instantiated:

Font1 = ImageFont.truetype("../Font/Font01.ttf",25)
Font2 = ImageFont.truetype("../Font/Font01.ttf",35)
Font3 = ImageFont.truetype("../Font/Font02.ttf",32)

You can use the fonts of Windows or other fonts which is in ttc format.. Note: Each character library contains different characters; If some characters cannot be displayed, it is recommended that you can refer to the encoding set ro used. To draw English characters, you can directly use the fonts; for Chinese characters, you need to add a symbol u:

draw.text((40, 50), 'WaveShare', fill = (128,255,128),font=Font2)
text= u"微雪电子"
draw.text((74, 150),text, fill = "WHITE",font=Font3)

The first parameter is a tuple of 2 elements, with (40, 50) as the left vertex, the font is Font2, and the fill is the font color. You can directly make fill = "WHITE", because the regular color value is already defined Well, of course, you can also use fill = (128,255,128), the parentheses correspond to the values of the three RGB colors so that you can precisely control the color you want. The second sentence shows Micro Snow Electronics, using Font3, the font color is white.

  • read local image

image = Image.open('../pic/LCD_1inch28.jpg')

The parameter is the image path.

  • Other functions.

Using with STM32

Software description

  • The demo is developed based on the HAL library. Download the demo, find the STM32 program file directory, and open the LCD_demo.uvprojx in the STM32\STM32F103RBT6\MDK-ARM directory to check the program.

  • Open main.c, you can see all the test programs, remove the comments in front of the test programs on the corresponding screen, and recompile and download.

LCD_0in96_test() 0.96inch LCD test program LCD_1in14_test() 1.14inch LCD test program LCD_1in28_test() 1.28inch LCD test program LCD_1in3_test() 1.3 inch LCD test program LCD_1in54_test() 1.54inch LCD test program LCD_1in8_test() 1.8inch LCD test program LCD_2in_test() 2inch LCD test program

Program Description

Underlying hardware interface

  • Data type

#define UBYTE      uint8_t
#define UWORD      uint16_t
#define UDOUBLE    uint32_t
  • Module initialization and exit processing

UBYTE	System_Init(void);
void    System_Exit(void);
Note: 
1.here is some GPIO processing before and after using the LCD screen.
2.After the System_Exit(void) function is used, the OLED display will be turned off;
  • Write and read GPIO

void 	DEV_Digital_Write(UWORD Pin, UBYTE Value);
UBYTE 	DEV_Digital_Read(UWORD Pin);
  • SPI write data

UBYTE	 SPI4W_Write_Byte(uint8_t value);

The upper application

For the screen, if you need to draw pictures, display Chinese and English characters, display pictures, etc., you can use the upper application to do, and we provide some basic functions here about some graphics processing in the directory STM32\STM32F103RB\User\GUI_DEV\GUI_Paint.c(.h) Note: Because of the size of the internal RAM of STM32 and arduino, the GUI is directly written to the RAM of the LCD.

The character font which GUI dependent is in the directory STM32\STM32F103RB\User\Fonts

  • New Image Properties: Create a new image property, this property includes the image buffer name, width, height, flip Angle, color.

void Paint_NewImage(UWORD Width, UWORD Height, UWORD Rotate, UWORD Color)
Parameters:
    Width: image buffer Width;
    Height: the Height of the image buffer;
    Rotate: Indicates the rotation Angle of an image
    Color: the initial Color of the image;
  • Set the clear screen function, usually call the clear function of LCD directly.

void Paint_SetClearFuntion(void (*Clear)(UWORD));
parameter:
    Clear : Pointer to the clear screen function, used to quickly clear the screen to a certain color;
  • Set the drawing pixel function

void Paint_SetDisplayFuntion(void (*Display)(UWORD,UWORD,UWORD));
parameter:
    Display: Pointer to the pixel drawing function, which is used to write data to the specified location in the internal RAM of the LCD;
  • Select image buffer:the purpose of the selection is that you can create multiple image attributes, image buffer can exist multiple, you can select each image you create.

void Paint_SelectImage(UBYTE *image)
Parameters:
    Image: the name of the image cache, which is actually a pointer to the first address of the image buffer
  • Image Rotation: Set the selected image rotation Angle, preferably after Paint_SelectImage(), you can choose to rotate 0, 90, 180, 270.

void Paint_SetRotate(UWORD Rotate)
Parameters:
    Rotate: ROTATE_0, ROTATE_90, ROTATE_180, and ROTATE_270 correspond to 0, 90, 180, and 270 degrees respectively;
  • Image mirror flip: Set the mirror flip of the selected image. You can choose no mirror, horizontal mirror, vertical mirror, or image center mirror.

void Paint_SetMirroring(UBYTE mirror)
Parameters:
    Mirror: indicates the image mirroring mode. MIRROR_NONE, MIRROR_HORIZONTAL, MIRROR_VERTICAL, MIRROR_ORIGIN correspond to no mirror, horizontal mirror, vertical mirror, and about image center mirror respectively.
  • Set points of display position and color in the buffer: here is the core GUI function, processing points display position and color in the buffer.

void Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color)
Parameters:
    Xpoint: the X position of a point in the image buffer
    Ypoint: Y position of a point in the image buffer
    Color: indicates the Color of the dot
  • Image buffer fill color: Fills the image buffer with a color, usually used to flash the screen into blank.

void Paint_Clear(UWORD Color)
Parameters:
    Color: fill Color
  • Image buffer part of the window filling color: the image buffer part of the window filled with a certain color, generally as a window whitewashing function, often used for time display, whitewashing on a second

void Paint_ClearWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color)
Parameters:
    Xstart: the x-starting coordinate of the window
    Ystart: indicates the Y starting point of the window
    Xend: the x-end coordinate of the window
    Yend: indicates the y-end coordinate of the window
    Color: fill Color
  • Draw points: In the image buffer, draw points on (Xpoint, Ypoint), you can choose the color, the size of the point, the style of the point.

void Paint_DrawPoint(UWORD Xpoint, UWORD Ypoint, UWORD Color, DOT_PIXEL Dot_Pixel, DOT_STYLE Dot_Style)
Parameters:
    Xpoint: indicates the X coordinate of a point
    Ypoint: indicates the Y coordinate of a point
    Color: fill Color
    Dot_Pixel: The size of the dot, providing a default of eight size points
        typedef enum {
            DOT_PIXEL_1X1   = 1,	// 1 x 1
            DOT_PIXEL_2X2  , 		// 2 X 2
            DOT_PIXEL_3X3  , 	 	// 3 X 3
            DOT_PIXEL_4X4  , 	 	// 4 X 4
            DOT_PIXEL_5X5  , 		// 5 X 5
            DOT_PIXEL_6X6  , 		// 6 X 6
            DOT_PIXEL_7X7  , 		// 7 X 7
            DOT_PIXEL_8X8  , 		// 8 X 8
        } DOT_PIXEL;
    Dot_Style: the size of a point that expands from the center of the point or from the bottom left corner of the point to the right and up
        typedef enum {
            DOT_FILL_AROUND  = 1,
            DOT_FILL_RIGHTUP,
        } DOT_STYLE;
  • Line drawing: In the image buffer, line from (Xstart, Ystart) to (Xend, Yend), you can choose the color, line width, line style.

void Paint_DrawLine(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, LINE_STYLE Line_Style ,  LINE_STYLE Line_Style)
Parameters:
    Xstart: the x-starting coordinate of a line
    Ystart: indicates the Y starting point of a line
    Xend: x-terminus of a line
    Yend: the y-end coordinate of a line
    Color: fill Color
    Line_width: The width of the line, which provides a default of eight widths
        typedef enum {
            DOT_PIXEL_1X1   = 1,	// 1 x 1
            DOT_PIXEL_2X2  , 		// 2 X 2
            DOT_PIXEL_3X3  ,		// 3 X 3
            DOT_PIXEL_4X4  ,		// 4 X 4
            DOT_PIXEL_5X5  , 		// 5 X 5
            DOT_PIXEL_6X6  , 		// 6 X 6
            DOT_PIXEL_7X7  , 		// 7 X 7
            DOT_PIXEL_8X8  , 		// 8 X 8
        } DOT_PIXEL;
    Line_Style: line style. Select whether the lines are joined in a straight or dashed way
        typedef enum {
            LINE_STYLE_SOLID = 0,
            LINE_STYLE_DOTTED,
        } LINE_STYLE;
  • Draw rectangle: In the image buffer, draw a rectangle from (Xstart, Ystart) to (Xend, Yend), you can choose the color, the width of the line, whether to fill the inside of the rectangle.

void Paint_DrawRectangle(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, DOT_PIXEL Line_width,  DRAW_FILL Draw_Fill)
Parameters:
        Xstart: the starting X coordinate of the rectangle
        Ystart: indicates the Y starting point of the rectangle
        Xend: X terminus of the rectangle
        Yend: specifies the y-end coordinate of the rectangle
        Color: fill Color
        Line_width: The width of the four sides of a rectangle. Default eight widths are provided
            typedef enum {
                DOT_PIXEL_1X1   = 1,	// 1 x 1
                DOT_PIXEL_2X2  , 		// 2 X 2
                DOT_PIXEL_3X3  ,		// 3 X 3
                DOT_PIXEL_4X4  ,		// 4 X 4
                DOT_PIXEL_5X5  , 		// 5 X 5
                DOT_PIXEL_6X6  , 		// 6 X 6
                DOT_PIXEL_7X7  , 		// 7 X 7
                DOT_PIXEL_8X8  , 		// 8 X 8
            } DOT_PIXEL;
        Draw_Fill: Fill, whether to fill the inside of the rectangle
            typedef enum {
                DRAW_FILL_EMPTY = 0,
                DRAW_FILL_FULL,
            } DRAW_FILL;
  • Draw circle: In the image buffer, draw a circle of Radius with (X_Center Y_Center) as the center. You can choose the color, the width of the line, and whether to fill the inside of the circle.

void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius, UWORD Color, DOT_PIXEL Line_width,  DRAW_FILL Draw_Fill)
Parameters:
    X_Center: the x-coordinate of the center of a circle
    Y_Center: Y coordinate of the center of a circle
    Radius: indicates the Radius of a circle
    Color: fill Color
    Line_width: The width of the arc, with a default of 8 widths
        typedef enum {
            DOT_PIXEL_1X1  = 1,	        // 1 x 1
            DOT_PIXEL_2X2  , 		// 2 X 2
            DOT_PIXEL_3X3  ,		// 3 X 3
            DOT_PIXEL_4X4  ,		// 4 X 4
            DOT_PIXEL_5X5  , 		// 5 X 5
            DOT_PIXEL_6X6  , 		// 6 X 6
            DOT_PIXEL_7X7  , 		// 7 X 7
            DOT_PIXEL_8X8  , 		// 8 X 8
        } DOT_PIXEL;
    Draw_Fill: fill, whether to fill the inside of the circle
        typedef enum {
            DRAW_FILL_EMPTY = 0,
            DRAW_FILL_FULL,
        } DRAW_FILL;
  • Write Ascii character: In the image buffer, at (Xstart Ystart) as the left vertex, write an Ascii character, you can select Ascii visual character library, font foreground color, font background color.

void Paint_DrawChar(UWORD Xstart, UWORD Ystart, const char Ascii_Char, sFONT* Font, UWORD Color_Foreground,  UWORD Color_Background)
Parameters:
    Xstart: the x-coordinate of the left vertex of a character
    Ystart: the Y coordinate of the font's left vertex
    Ascii_Char: indicates the Ascii character
    Font: Ascii visual character library, in the Fonts folder provides the following Fonts:
        Font8: 5*8 font
        Font12: 7*12 font
        Font16: 11*16 font
        Font20: 14*20 font
        Font24: 17*24 font
    Color_Foreground: Font color
    Color_Background: indicates the background color
  • Write English string: In the image buffer, use (Xstart Ystart) as the left vertex, write a string of English characters, can choose Ascii visual character library, font foreground color, font background color.

void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground,  UWORD Color_Background)
Parameters:
    Xstart: the x-coordinate of the left vertex of a character
    Ystart: the Y coordinate of the font's left vertex
    PString: string, string is a pointer
    Font: Ascii visual character library, in the Fonts folder provides the following Fonts:
        Font8: 5*8 font
        Font12: 7*12 font
        Font16: 11*16 font
        Font20: 14*20 font
        Font24: 17*24 font
     Color_Foreground: Font color
     Color_Background: indicates the background color
  • Write Chinese string: in the image buffer, use (Xstart Ystart) as the left vertex, write a string of Chinese characters, you can choose GB2312 encoding character font, font foreground color, font background color.

void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font, UWORD Color_Foreground,  UWORD Color_Background)
Parameters:
    Xstart: the x-coordinate of the left vertex of a character
    Ystart: the Y coordinate of the font's left vertex
    PString: string, string is a pointer
    Font: GB2312 encoding character Font library, in the Fonts folder provides the following Fonts:
        Font12CN: ASCII font 11*21, Chinese font 16*21
        Font24CN: ASCII font24 *41, Chinese font 32*41
    Color_Foreground: Font color
    Color_Background: indicates the background color
  • Write numbers: In the image buffer,use (Xstart Ystart) as the left vertex, write a string of numbers, you can choose Ascii visual character library, font foreground color, font background color.

void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, double Nummber, sFONT* Font, UWORD Digit, UWORD Color_Foreground,   UWORD Color_Background)
Parameters:
    Xpoint: the x-coordinate of the left vertex of a character
    Ypoint: the Y coordinate of the left vertex of the font
    Nummber: indicates the number displayed, which can be a decimal
    Digit: It's a decimal number
    Font: Ascii visual character library, in the Fonts folder provides the following Fonts:
        Font8: 5*8 font
        Font12: 7*12 font
        Font16: 11*16 font
        Font20: 14*20 font
        Font24: 17*24 font
    Color_Foreground: Font color
    Color_Background: indicates the background color
  • Display time: in the image buffer,use (Xstart Ystart) as the left vertex, display time,you can choose Ascii visual character font, font foreground color, font background color.

void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, UWORD Color_Background,  UWORD Color_Foreground)
Parameters:
    Xstart: the x-coordinate of the left vertex of a character
    Ystart: the Y coordinate of the font's left vertex
    PTime: display time, here defined a good time structure, as long as the hour, minute and second bits of data to the parameter;
    Font: Ascii visual character library, in the Fonts folder provides the following Fonts:
        Font8: 5*8 font
        Font12: 7*12 font
        Font16: 11*16 font
        Font20: 14*20 font
        Font24: 17*24 font
    Color_Foreground: Font color
    Color_Background: indicates the background color

Arduino Software Description

Run program

Please select the corresponding program according to the LCD screen model to open

You can view test programs for all screen sizes, sorted by size: For example, 1.54inch LCD Module. Open the LCD_1inch54 folder and run the LCD_1inch54.ino file. Open the program, select the development board model Arduino UNO

Select the corresponding COM port

Then click to compile and download

Program Description

Document Introduction

Take Arduino UNO controlling a 1.54-inch LCD as an example, open the Arduino\LCD_1inch54 directory:

Of which: LCD_1inch54.ino: open with Arduino IDE; LCD_Driver.cpp(.h): is the driver of the LCD screen; DEV_Config.cpp(.h): It is the hardware interface definition, which encapsulates the read and write pin levels, SPI transmission data, and pin initialization; font8.cpp, font12.cpp, font16.cpp, font20.cpp, font24.cpp, font24CN.cpp, fonts.h: fonts for characters of different sizes; image.cpp(.h): is the image data, which can convert any BMP image into a 16-bit true color image array through Img2Lcd (downloadable in the development data). The program is divided into bottom-layer hardware interface, middle-layer LCD screen driver, and upper-layer application;

Underlying hardware interface

The hardware interface is defined in the two files DEV_Config.cpp(.h), and functions such as read and write pin level, delay, and SPI transmission are encapsulated.

  • write pin level

void DEV_Digital_Write(int pin, int value)

The first parameter is the pin, and the second is the high and low level.

  • Read pin level

int DEV_Digital_Read(int pin)

The parameter is the pin, and the return value is the level of the read pin.

  • Delay

DEV_Delay_ms(unsigned int delaytime)

millisecond level delay.

  • SPI output data

DEV_SPI_WRITE(unsigned char data)

The parameter is char type, occupying 8 bits.

The upper application

For the screen, if you need to draw pictures, display Chinese and English characters, display pictures, etc., you can use the upper application to do, and we provide some basic functions here about some graphics processing in the directory GUI_Paint.c(.h) Note: Because of the size of the internal RAM of STM32 and arduino, the GUI is directly written to the RAM of the LCD.

The fonts used by the GUI all depend on the font*.cpp(h) files under the same file

  • New Image Properties: Create a new image property, this property includes the image buffer name, width, height, flip Angle, color.

void Paint_NewImage(UWORD Width, UWORD Height, UWORD Rotate, UWORD Color)
Parameters:
    Width: image buffer Width;
    Height: the Height of the image buffer;
    Rotate: Indicates the rotation Angle of an image
    Color: the initial Color of the image;
  • Set the clear screen function, usually call the clear function of LCD directly.

void Paint_SetClearFuntion(void (*Clear)(UWORD));
parameter:
    Clear : Pointer to the clear screen function, used to quickly clear the screen to a certain color;
  • Set the drawing pixel function.

void Paint_SetDisplayFuntion(void (*Display)(UWORD,UWORD,UWORD));
parameter:
    Display: Pointer to the pixel drawing function, which is used to write data to the specified location in the internal RAM of the LCD;
  • Select image buffer:the purpose of the selection is that you can create multiple image attributes, image buffer can exist multiple, you can select each image you create.

void Paint_SelectImage(UBYTE *image)
Parameters:
    Image: the name of the image cache, which is actually a pointer to the first address of the image buffer
  • Image Rotation: Set the selected image rotation Angle, preferably after Paint_SelectImage(), you can choose to rotate 0, 90, 180, 270.

void Paint_SetRotate(UWORD Rotate)
Parameters:
    Rotate: ROTATE_0, ROTATE_90, ROTATE_180, and ROTATE_270 correspond to 0, 90, 180, and 270 degrees respectively;
  • Image mirror flip: Set the mirror flip of the selected image. You can choose no mirror, horizontal mirror, vertical mirror,or image center mirror.

void Paint_SetMirroring(UBYTE mirror)
Parameters:
    Mirror: indicates the image mirroring mode. MIRROR_NONE, MIRROR_HORIZONTAL, MIRROR_VERTICAL, MIRROR_ORIGIN correspond to no mirror, horizontal mirror, vertical mirror, and about image center mirror respectively.
  • Set points of display position and color in the buffer: here is the core GUI function, processing points display position and color in the buffer.

void Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color)
Parameters:
    Xpoint: the X position of a point in the image buffer
    Ypoint: Y position of a point in the image buffer
    Color: indicates the Color of the dot
  • Image buffer fill color: Fills the image buffer with a color, usually used to flash the screen into blank.

void Paint_ClearWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color)
Parameters:
    Xstart: the x-starting coordinate of the window
    Ystart: indicates the Y starting point of the window
    Xend: the x-end coordinate of the window
    Yend: indicates the y-end coordinate of the window
    Color: fill Color
  • Draw points: In the image buffer, draw points on (Xpoint, Ypoint), you can choose the color, the size of the point, the style of the point.

void Paint_DrawPoint(UWORD Xpoint, UWORD Ypoint, UWORD Color, DOT_PIXEL Dot_Pixel, DOT_STYLE Dot_Style)
Parameters:
    Xpoint: indicates the X coordinate of a point
    Ypoint: indicates the Y coordinate of a point
    Color: fill Color
    Dot_Pixel: The size of the dot, providing a default of eight size points
        typedef enum {
                DOT_PIXEL_1X1  = 1,	        // 1 x 1
                DOT_PIXEL_2X2  , 		// 2 X 2
                DOT_PIXEL_3X3  , 	 	// 3 X 3
                DOT_PIXEL_4X4  , 	 	// 4 X 4
                DOT_PIXEL_5X5  , 		// 5 X 5
                DOT_PIXEL_6X6  , 		// 6 X 6
                DOT_PIXEL_7X7  , 		// 7 X 7
                DOT_PIXEL_8X8  , 		// 8 X 8
        } DOT_PIXEL;
    Dot_Style: the size of a point that expands from the center of the point or from the bottom left corner of the point to the right and up
        typedef enum {
                DOT_FILL_AROUND  = 1,
                DOT_FILL_RIGHTUP,
        } DOT_STYLE;
  • Line drawing: In the image buffer, line from (Xstart, Ystart) to (Xend, Yend), you can choose the color, line width, line style.

void Paint_DrawLine(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, LINE_STYLE Line_Style ,  LINE_STYLE Line_Style)
Parameters:
        Xstart: the x-starting coordinate of a line
        Ystart: indicates the Y starting point of a line
        Xend: x-terminus of a line
        Yend: the y-end coordinate of a line
        Color: fill Color
        Line_width: The width of the line, which provides a default of eight widths
                typedef enum {
                        DOT_PIXEL_1X1  = 1,	        // 1 x 1
                        DOT_PIXEL_2X2  , 		// 2 X 2
                        DOT_PIXEL_3X3  ,		// 3 X 3
                        DOT_PIXEL_4X4  ,		// 4 X 4
                        DOT_PIXEL_5X5  , 		// 5 X 5
                        DOT_PIXEL_6X6  , 		// 6 X 6
                        DOT_PIXEL_7X7  , 		// 7 X 7
                        DOT_PIXEL_8X8  , 		// 8 X 8
                    } DOT_PIXEL;
        Line_Style: line style. Select whether the lines are joined in a straight or dashed way
                typedef enum {
                        LINE_STYLE_SOLID = 0,
                        LINE_STYLE_DOTTED,
                } LINE_STYLE;
  • Draw rectangle: In the image buffer, draw a rectangle from (Xstart, Ystart) to (Xend, Yend), you can choose the color, the width of the line, whether to fill the inside of the rectangle.

void Paint_DrawRectangle(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, DOT_PIXEL Line_width,  DRAW_FILL Draw_Fill)
Parameters:
        Xstart: the starting X coordinate of the rectangle
        Ystart: indicates the Y starting point of the rectangle
        Xend: X terminus of the rectangle
        Yend: specifies the y-end coordinate of the rectangle
        Color: fill Color
        Line_width: The width of the four sides of a rectangle. Default eight widths are provided
        typedef enum {
                DOT_PIXEL_1X1  = 1,	        // 1 x 1
                DOT_PIXEL_2X2  , 		// 2 X 2
                DOT_PIXEL_3X3  ,		// 3 X 3
                DOT_PIXEL_4X4  ,		// 4 X 4
                DOT_PIXEL_5X5  , 		// 5 X 5
                DOT_PIXEL_6X6  , 		// 6 X 6
                DOT_PIXEL_7X7  , 		// 7 X 7
                DOT_PIXEL_8X8  , 		// 8 X 8
        } DOT_PIXEL;
        Draw_Fill: Fill, whether to fill the inside of the rectangle
        typedef enum {
                DRAW_FILL_EMPTY = 0,
                DRAW_FILL_FULL,
        } DRAW_FILL;
  • Draw circle: In the image buffer, draw a circle of Radius with (X_Center Y_Center) as the center. You can choose the color, the width of the line, and whether to fill the inside of the circle.

void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius, UWORD Color, DOT_PIXEL Line_width,  DRAW_FILL Draw_Fill)
Parameters:
        X_Center: the x-coordinate of the center of a circle
        Y_Center: Y coordinate of the center of a circle
        Radius: indicates the Radius of a circle
        Color: fill Color
        Line_width: The width of the arc, with a default of 8 widths
        typedef enum {
                DOT_PIXEL_1X1  = 1,	        // 1 x 1
                DOT_PIXEL_2X2  , 		// 2 X 2
                DOT_PIXEL_3X3  ,		// 3 X 3
                DOT_PIXEL_4X4  ,		// 4 X 4
                DOT_PIXEL_5X5  , 		// 5 X 5
                DOT_PIXEL_6X6  , 		// 6 X 6
                DOT_PIXEL_7X7  , 		// 7 X 7
                DOT_PIXEL_8X8  , 		// 8 X 8
        } DOT_PIXEL;
        Draw_Fill: fill, whether to fill the inside of the circle
        typedef enum {
                DRAW_FILL_EMPTY = 0,
                DRAW_FILL_FULL,
        } DRAW_FILL;
  • Write Ascii character: In the image buffer, at (Xstart Ystart) as the left vertex, write an Ascii character, you can select Ascii visual character library, font foreground color, font background color.

void Paint_DrawChar(UWORD Xstart, UWORD Ystart, const char Ascii_Char, sFONT* Font, UWORD Color_Foreground,  UWORD Color_Background)
Parameters:
        Xstart: the x-coordinate of the left vertex of a character
        Ystart: the Y coordinate of the font's left vertex
        Ascii_Char: indicates the Ascii character
        Font: Ascii visual character library, in the Fonts folder provides the following Fonts:
                Font8: 5*8 font
                Font12: 7*12 font
                Font16: 11*16 font
                Font20: 14*20 font
                Font24: 17*24 font
        Color_Foreground: Font color
        Color_Background: indicates the background color
  • Write English string: In the image buffer, use (Xstart Ystart) as the left vertex, write a string of English characters, can choose Ascii visual character library, font foreground color, font background color.

void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground,  UWORD Color_Background)
Parameters:
        Xstart: the x-coordinate of the left vertex of a character
        Ystart: the Y coordinate of the font's left vertex
        PString: string, string is a pointer
        Font: Ascii visual character library, in the Fonts folder provides the following Fonts:
                Font8: 5*8 font
                Font12: 7*12 font
                Font16: 11*16 font
                Font20: 14*20 font
                Font24: 17*24 font
        Color_Foreground: Font color
        Color_Background: indicates the background color
  • Write Chinese string: in the image buffer, use (Xstart Ystart) as the left vertex, write a string of Chinese characters, you can choose GB2312 encoding character font, font foreground color, font background color.

void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font, UWORD Color_Foreground,  UWORD Color_Background)
Parameters:
        Xstart: the x-coordinate of the left vertex of a character
        Ystart: the Y coordinate of the font's left vertex
        PString: string, string is a pointer
        Font: GB2312 encoding character Font library, in the Fonts folder provides the following Fonts:
                Font12CN: ASCII font 11*21, Chinese font 16*21
                Font24CN: ASCII font24 *41, Chinese font 32*41
                Color_Foreground: Font color
                Color_Background: indicates the background color
  • Write numbers: In the image buffer,use (Xstart Ystart) as the left vertex, write a string of numbers, you can choose Ascii visual character library, font foreground color, font background color.

void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, double Nummber, sFONT* Font, UWORD Digit, UWORD Color_Foreground,   UWORD Color_Background)
Parameters:
        Xpoint: the x-coordinate of the left vertex of a character
        Ypoint: the Y coordinate of the left vertex of the font
        Nummber: indicates the number displayed, which can be a decimal
        Digit: It's a decimal number
        Font: Ascii visual character library, in the Fonts folder provides the following Fonts:
                Font8: 5*8 font
                Font12: 7*12 font
                Font16: 11*16 font
                Font20: 14*20 font
                Font24: 17*24 font
        Color_Foreground: Font color
        Color_Background: indicates the background color
  • Write numbers with decimals: at (Xstart Ystart) as the left vertex, write a string of numbers with decimals, you can choose Ascii code visual character font, font foreground color, font background color

void Paint_DrawFloatNum(UWORD Xpoint, UWORD Ypoint, double Nummber, UBYTE Decimal_Point, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
parameter:
         Xstart: the X coordinate of the left vertex of the character
         Ystart: Y coordinate of the left vertex of the font
         Nummber: the displayed number, which is saved in double type here
         Decimal_Point: Displays the number of digits after the decimal point
         Font: Ascii code visual character font library, the following fonts are provided in the Fonts folder:
                Font8: 5*8 font
                Font12: 7*12 font
                Font16: 11*16 font
                Font20: 14*20 font
                Font24: 17*24 font
        Color_Foreground: font color
        Color_Background: background color
  • Display time: in the image buffer,use (Xstart Ystart) as the left vertex, display time,you can choose Ascii visual character font, font foreground color, font background color.

void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, UWORD Color_Background,  UWORD Color_Foreground)
Parameters:
        Xstart: the x-coordinate of the left vertex of a character
        Ystart: the Y coordinate of the font's left vertex
        PTime: display time, here defined a good time structure, as long as the hour, minute and second bits of data to the parameter;
        Font: Ascii visual character library, in the Fonts folder provides the following Fonts:
                Font8: 5*8 font
                Font12: 7*12 font
                Font16: 11*16 font
                Font20: 14*20 font
                Font24: 17*24 font
        Color_Foreground: Font color
        Color_Background: indicates the background color
  • Display image: at (Xstart Ystart) as the left vertex, display an image whose width is W_Image and height is H_Image;

void Paint_DrawImage(const unsigned char *image, UWORD xStart, UWORD yStart, UWORD W_Image, UWORD H_Image)
parameter:
       image: image address, pointing to the image information you want to display
       Xstart: the X coordinate of the left vertex of the character
       Ystart: Y coordinate of the left vertex of the font
       W_Image: Image width
       H_Image: Image height

VisionFive2

Adaptive Model

Hardware Connection

LCD
VisionFive2 Board Pin No.

VCC

3.3V

GND

GND

DIN

19

CLK

23

CS

24

DC

22

RST

13

BL

12

Install Corresponding Libraries

apt-get install pip
pip install VisionFive.gpio
apt-get install python3-numpy
apt-get install python3-pil

Demo Download

apt-get install p7zip-full
wget https://files.waveshare.com/upload/e/e9/LCD_Module_code.7z
7z x LCD_Module_code.7z -o./LCD_Module_code
cd LCD_Module_code/VisionFive/python/example/

Run the Corresponding Demo According to the Screen You Purchased

python3 0inch96_LCD_test.py
python3 1inch14_LCD_test.py
python3 1inch28_LCD_test.py
python3 1inch3_LCD_test.py
python3 1inch54_LCD_test.py
python3 1inch8_LCD_test.py
python3 2inch_LCD_test.py
python3 2inch4_LCD_test.py

Resources

Documents

Software

Demo Codes

3D Drawing

FAQ

Take the developed by our company as an example, the connection is as follows:

Test programs for all screens can be viewed, sorted by size: 0inch96_LCD_test.py: 0.96inch LCD test program 1inch14_LCD_test.py: 1.14inch LCD test program 1inch28_LCD_test.py: 1.28inch LCD test program 1inch3_LCD_test.py: 1.3inch LCD test program 1inch47_LCD_test.py: 1.47inch LCD test program 1inch54_LCD_test.py: 1.54inchLCD test program 1inch8_LCD_test.py: 1.8inch LCD test program 2inch_LCD_test.py: 2inch LCD test program 2inch4_LCD_test.py: 2inch4 LCD test program

Python has an image library , it does not need to write code from the logical layer like C and can directly call to the image library for image processing. The following will take a 1.54-inch LCD as an example, we provide a brief description of the demo.

For more information, you can refer to pil

Note: The demos are all tested on Arduino uno. If you need other types of Arduino, you need to determine whether the connected pins are correct.

In the product encyclopedia interface download , and then unzip it. The Arduino program is located at ~/Arduino/…

3.3V 31.2mA

The thread specification is M2.0*1.0.

XNUCLEO-F103RB development board
PIL official library link
http://effbot.org/imagingbook
Template: Arduino IDE Installation Steps
the program
0.96inch LCD Module
1.14inch LCD Module
1.28inch LCD Module
1.3inch LCD Module
1.54inch LCD Module
1.8inch LCD Module
2inch LCD Module
2.4inch LCD Module
Schematic
GC9A01A manual
lcd
Image2Lcd
Sample demo
1.28inch LCD Module 3D Drawing
What is the maximum power consumption of the 1.28-inch LCD Module?
I would like to know the specification for fastening screws.
LogoWaveshare 65K RGB General 1.28inch Round LCD Display ModuleOpenELAB