This library provides a set of functions to control an ST7789-based LCD display using the Raspberry Pi Pico. It allows for easy drawing of basic shapes, text rendering, and color manipulation.
- Initialize and configure the ST7789 LCD
- Draw basic shapes: pixels, lines, rectangles, circles
- Render text using a 5x7 pixel font
- Fill screen with solid colors
- 16-bit color support (RGB565)
- Raspberry Pi Pico
- ST7789-based LCD display
- Appropriate connections between the Pico and the LCD
Raspberry Pi Pico | ST7789 LCD |
---|---|
GPIO 13 | BL (Backlight) |
GPIO 8 | DC (Data/Command) |
GPIO 12 | RST (Reset) |
GPIO 11 | MOSI |
GPIO 10 | SCK |
GPIO 9 | CS |
-
Clone this repository into your Raspberry Pi Pico project directory:
git clone https://github.com/yourusername/lcd-st7789-library.git
-
Include the library headers in your project:
#include "lcd_st7789_library.h"
-
Make sure to link against the library when compiling your project.
Here's a basic example of how to use the library:
#include "pico/stdlib.h"
#include "lcd_st7789_library.h"
int main() {
// Initialize the LCD
lcd_init();
// Fill the screen with blue
lcd_fill_color(create_color(0, 0, 255));
// Draw a white rectangle
lcd_draw_rect(10, 10, 100, 50, create_color(255, 255, 255));
// Draw some text
lcd_draw_text(20, 20, "Hello, World!", create_color(255, 0, 0), create_color(0, 0, 255), 2);
while(1) {
// Your main loop
}
return 0;
}
See lcd_st7789_library.h
for a complete list of available functions and their descriptions.
Contributions to improve the library are welcome. Please feel free to submit a Pull Request.
- This library was developed for use with the Raspberry Pi Pico.
- Thanks to the Raspberry Pi Foundation for their excellent SDK and documentation.