Mundarija:
2025 Muallif: John Day | [email protected]. Oxirgi o'zgartirilgan: 2025-01-13 06:58
Hammaga salom
Men bu ta'limda LCD5110_GRAPH kutubxonasi va Bitmap grafikasi funktsiyalari bilan tanishmoqchiman. Men shunday qaror qildim, chunki agar siz mening sahifamda "Space Race Game" loyihasini ko'rsangiz, men sizga bitmap grafikasini qanday yasashni ko'rsatmaganman. Boshlaylik…
1 -qadam: 5110LCD displeyining xususiyatlari va ulanishi
Xususiyatlari:
- 84 × 48 piksel
- Faqat 3.3V
Ulanish:
- VCC -> Arduino 3.3V (yoki 5v)
- BL -> Arduino pin 3 (pwm pin)
- GND -> Arduino GND
- CLK (SCLK) -> Arduino pin 8
- Din (MOSI) -> Arduino pin 9
- DC -> Arduino pin 10
- Idoralar yoki CS -> Arduino pin 12
- RST (RESET) -> Arduino pin 11
2 -qadam: BMP FILE
Sizga bmp faylini qanday yaratishni asta -sekin ko'rsataman.
1-Grafika yarating, men buning uchun Photo Editor-dan foydalanaman:
- Foto muharririga kiring
- "Yangi yaratish" tugmachasini kiriting
- Kenglik = 84 va balandlik = 48 ni tanlang
- O'zingiz xohlagan narsani chizib oling
- -j.webp" />
2-j.webp
- -j.webp" />
- Konvertatsiya qilish
- Saqlash
3-.c faylini yarating. Buning uchun men LCD yordamchisidan foydalanaman:
- Dowland
- "Fayl" tugmachasini, so'ng "Rasmni yuklash" ni kiriting.
- "Chiqishni saqlash" ni kiriting
- . C formatini saqlashga ishonch hosil qiling
4 -c faylini ishlatadigan kod papkasiga joylashtiring.
3 -qadam: KOD
Men 5110LCD_Graph dan foydalanaman va sizga ba'zi funktsiyalarni ko'rsataman. Agar siz barcha funktsiyalarni o'rganmoqchi bo'lsangiz, pdf faylini toping.
#include // kutubxonani o'z ichiga oladi
tashqi uint8_t SAT ; //.c faylini tasvirlab bering
int BL = 3; // orqa nuri tasvirlab bering
LCD5110 lcd (8, 9, 10, 11, 12); // LCD5110 nomi (clk, din, DC, rst, ce);
bo'sh o'rnatish () {
pinMode (BL, OUTPUT); lcd. InitLCD (); // nomi. InitLCD (); lcd.setContrast (55) ekranini ishga tushiring; //name.setContrast (); kontrastni o'rnatish (0 dan 127 gacha)}
void loop () {
analogWrite (BL, 330); lcd.clrScr (); // ism.clrScr (); lcd.drawBitmap ekranini tozalash (0, 0, SAT, 84, 48); //name.drawBitmap(x, y, nomi (.c), kengligi (.c), balandligi (.c)); lcd.update (); // ism.update (); ekranni yangilang}
// --------------------- Yangi jadval yaratish ------------------------ ------------------------ // LCD yordamchisi yaratgan fayl // https://en.radzio.dxp.pl/bitmap_converter/ //- -------------------------------------------------- --------------------------- #include // PROGMEMdan foydalanish uchun ushbu kutubxonani o'z ichiga oladi // PROGMEM kichik RAMdan foydalanishga yordam beradi.] 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, 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, 0x1F, 0x1F, 0x1F. 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0xFF, 0xF7, 0xFF, 0x1F, 0x1F, 0x1F, 0x17, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F. 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, 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0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0FFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,};
4 -qadam: Ko'rganingiz uchun RAHMAT
O'qiganingiz uchun katta rahmat! Agar sizda biron bir savol bo'lsa, men bilan bog'laning yoki sharh yozing …