Table des matières:

Éducation graphique LCD5110 : 4 étapes
Éducation graphique LCD5110 : 4 étapes

Vidéo: Éducation graphique LCD5110 : 4 étapes

Vidéo: Éducation graphique LCD5110 : 4 étapes
Vidéo: Astuces pour construire un graphique 2024, Juillet
Anonim
LCD5110 Éducation graphique
LCD5110 Éducation graphique

Salut tout le monde

Dans cette formation, je vais vous présenter la bibliothèque LCD5110_GRAPH et les fonctions de Bitmap Graphic. J'ai décidé cela parce que si vous voyez le projet Space Race Game sur ma page, je ne vous ai pas montré comment créer un graphique bitmap. Commençons…

Étape 1: Caractéristiques et connexion de l'écran 5110LCD

Caractéristiques et connexion de l'écran 5110LCD
Caractéristiques et connexion de l'écran 5110LCD

Caractéristiques:

  • 84 × 48 pixels
  • Alimentation 3.3V

Lien:

  • VCC -> Arduino 3.3V (ou 5v)
  • BL -> broche Arduino 3 (broche pwm)
  • GND -> Arduino GND
  • CLK (SCLK) -> Arduino broche 8
  • DIN (MOSI) -> Arduino broche 9
  • CC -> Arduino broche 10
  • CE ou CS -> Arduino broche 12
  • RST (RESET) -> broche Arduino 11

Étape 2: FICHIER BMP

FICHIER BMP
FICHIER BMP
FICHIER BMP
FICHIER BMP
FICHIER BMP
FICHIER BMP
FICHIER BMP
FICHIER BMP

Je vais vous montrer étape par étape comment créer un fichier bmp.

1-Créez des graphiques. J'utilise Photo Editor pour cela:

  • Entrez dans l'éditeur de photos
  • Entrez le bouton "Créer un nouveau"
  • Sélectionnez la largeur=84 et la hauteur=48
  • Dessine ce que tu veux
  • Enregistrer en tant que.jpg

2-Convertir le fichier-j.webp

  • Téléchargez votre fichier.jpg
  • Convertir
  • sauvegarder

3-Créez un fichier.c. J'utilise LCD Assistant pour cela:

  • Downland il
  • Entrez le bouton "fichier" puis "Charger l'image"
  • Entrez "Enregistrer la sortie"
  • Assurez-vous d'enregistrer le format.c

4-Collez le fichier.c dans le dossier de code que vous utilisez.

Étape 3: CODEZ

CODE
CODE

J'utilise 5110LCD_Graph et je vais vous montrer quelques fonctions. Si vous voulez apprendre toutes les fonctions, téléchargez le fichier pdf.

#include //inclure la bibliothèque

extern uint8_t SAT; //décrire le fichier.c

int BL=3; //décrire le rétro-éclairage

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

void setup() {

pinMode(BL, SORTIE); lcd. InitLCD(); //nom. InitLCD(); initialiser l'écran lcd.setContrast(55); //nom.setContrast(); régler le contraste (entre 0 et 127) }

boucle vide() {

analogWrite(BL, 330); lcd.clrScr(); //nom.clrScr(); effacez l'écran lcd.drawBitmap(0, 0, SAT, 84, 48); //nom.drawBitmap(x, y, nom(.c), largeur(.c), hauteur(.c)); lcd.update(); //nom.update(); mettre à jour l'écran }

//---------------------CRÉER UN NOUVEL ONGLET------------------------ ------------------------// Fichier généré par LCD Assistant // https://en.radzio.dxp.pl/bitmap_converter/ //- -------------------------------------------------- --------------------------- #include //include cette bibliothèque pour l'utilisation de PROGMEM //PROGMEM aide à utiliser une petite consommation de RAM 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, 0xFF, 0xFB, 0xFF, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,F, 0x1F, 0x1F,Fx1 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0xFF, 0xF7, 0xFF, 0x1F, 0x1F, 0x1F, 0x17, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1, 0x1F,Fx1 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00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