Tabla de contenido:

Educación gráfica LCD5110: 4 pasos
Educación gráfica LCD5110: 4 pasos

Video: Educación gráfica LCD5110: 4 pasos

Video: Educación gráfica LCD5110: 4 pasos
Video: Gráficos con lcd nokia 5110 2024, Mes de julio
Anonim
Educación gráfica LCD5110
Educación gráfica LCD5110

Hola a todos

En esta educación, me gustaría introducir la biblioteca LCD5110_GRAPH y las funciones sobre gráficos de mapa de bits. Decidí esto porque si ves el proyecto Space Race Game en mi página, no te mostré cómo puedes hacer un gráfico de mapa de bits. Vamos a empezar…

Paso 1: Funciones y conexión de la pantalla 5110LCD

Características y conexión de la pantalla 5110LCD
Características y conexión de la pantalla 5110LCD

Características:

  • 84 × 48 píxeles
  • Suplly 3.3V

Conexión:

  • VCC -> Arduino 3.3V (o 5v)
  • BL -> Pin 3 de Arduino (pin pwm)
  • GND -> Arduino GND
  • CLK (SCLK) -> Pin 8 de Arduino
  • DIN (MOSI) -> Pin 9 de Arduino
  • DC -> Pin 10 de Arduino
  • CE o CS -> Pin 12 de Arduino
  • RST (RESET) -> Pin 11 de Arduino

Paso 2: ARCHIVO BMP

ARCHIVO BMP
ARCHIVO BMP
ARCHIVO BMP
ARCHIVO BMP
ARCHIVO BMP
ARCHIVO BMP
ARCHIVO BMP
ARCHIVO BMP

Le mostraré paso a paso cómo creamos un archivo bmp.

1-Crea algunos gráficos, uso Photo Editor para esto:

  • Entrar en el editor de fotos
  • Introduzca el botón "Crear nuevo"
  • Seleccione ancho = 84 y alto = 48
  • Dibuja lo que quieras
  • Guardar como.jpg

2-Convertir archivo-j.webp

  • Sube tu archivo.jpg
  • Convertir
  • Ahorrar

3-Crea un archivo.c. Utilizo LCD Assistant para esto:

  • Dowland es
  • Ingrese el botón "archivo" y luego "Cargar imagen"
  • Ingrese "Guardar salida"
  • Asegúrese de guardar el formato.c

4-Pegue el archivo.c en la carpeta de código que utilice.

Paso 3: CÓDIGO

CÓDIGO
CÓDIGO

Yo uso 5110LCD_Graph y les mostraré algunas funciones. Si desea aprender todas las funciones, baje el archivo pdf.

#include // incluye biblioteca

extern uint8_t SAT ; // describe el archivo.c

int BL = 3; // describe la luz de fondo

LCD5110 lcd (8, 9, 10, 11, 12); // Nombre LCD5110 (clk, din, dc, rst, ce);

configuración vacía () {

pinMode (BL, SALIDA); lcd. InitLCD (); //nombre. InitLCD (); iniciar la pantalla lcd.setContrast (55); //name.setContrast (); establecer contraste (entre 0 y 127)}

bucle vacío () {

escritura analógica (BL, 330); lcd.clrScr (); //nombre.clrScr (); borrar la pantalla lcd.drawBitmap (0, 0, SAT, 84, 48); //nombre.drawBitmap(x, y, nombre (.c), ancho (.c), alto (.c)); lcd.update (); //name.update (); actualizar la pantalla}

// --------------------- CREAR NUEVA PESTAÑA ------------------------ ------------------------ // Archivo generado por LCD Assistant // https://en.radzio.dxp.pl/bitmap_converter/ // - -------------------------------------------------- --------------------------- #include // incluye esta biblioteca para usar PROGMEM // PROGMEM ayuda a usar RAM pequeña const unsigned char SAT PROGMEM = {0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0xFF, 0xFB, 0xFF, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1x1, 0x1F, 0x1F, 0x1x1, 0x1F, 0x1F, 0x1x1, 0x1F, 0x1F, 0x1x1, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0xFF, 0xF7, 0xFF, 0x1F, 0x1F, 0x1F, 0x17, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1x1, 0x1F, 0x1F, 0x1x1, 0x1F, 0xF, 0x1x1, 0x1F, 0x1F, 0x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