Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:examples:display:lcd_graphic [2010/02/08 13:00] mikk.leinien:examples:display:lcd_graphic [2020/07/20 09:00] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Graphic LCD ====== ====== Graphic LCD ======
  
-//Vajalikud teadmised: [HW] [[en:hardware:homelab:lcd]], [LIB] [[en:software:homelab:library:module:lcd_graphic]], [LIB] [[en:software:homelab:library:delay]], [PRT] [[en:examples:display:lcd_alphanumeric]]//+//Necessary knowledge: [HW] [[en:hardware:homelab:digi]], [LIB] [[en:software:homelab:library:module:lcd_graphic]], [LIB] [[en:software:homelab:library:delay]], [PRT] [[en:examples:display:lcd_alphanumeric]]//
  
-===== Teooria =====+===== Theory =====
  
-Graafiline LCD on vedelkristall-ekraan, millega saab peale teksti ka kujundeid kuvadaSelle ehitus sarnaneb alfabeetilisele LCD-lepõhiline erinevus seisneb selles, et graafilisel ekraanil on kõik pikslid jaotatud üle ekraani ühe suure maatriksinaKui tegu on monokromaatilise graafilise LCD ekraanigasiis piksel on üks pisike ruudukujuline segment. Värvilistel ekraanidel moodustab üks piksel kolmest alampikslistmillest igaüks laseb läbi värvifiltri kas punast, rohelist või sinist valgustKuna alampikslid on lähestikkupaistavad need kui üks piksel.+Graphical LCD //liquid crystal display// is a display which allows displaying pictures and textIts construction is similar to the alphanumerical LCD, with a difference that on the graphic display all pixels are divided as one large matrixIf we are dealing with a monochrome LCD, then a pixel is one square segment. Color displays’ one pixel is formed of three subpixels. Each of the three subpixels lets only one colored light pass (redgreen or blue)Since the subpixels are positioned very close to each otherthey seem like one pixel.
  
-[{{  :examples:display:lcd_graphic:lcd_graphic_abc.png?200|Graafilise LCD pikslitest moodustatud tekst}}]+[{{  :examples:display:lcd_graphic:lcd_graphic_abc.png?200|The text formed of pixels of a graphic LCD.}}]
  
-Monokromaatilised graafilised ekraanid on tavaliselt passiivmaatriksigasuured värvilised ekraanid, kaasa arvatud arvutiekraanid, on aktiivmaatriksigaKogu tausta- ja pikslite värvi puudutav info on graafilistel LCD-del sama mis alfabeetilistelgi - ehk siis leidub palju varianteNing sarnaselt alfabeetiliste ekraanidega on ka graafilistel ekraanidel eraldi kontrollermis hoolitseb sideliidese kaudu info vastuvõtmise ja segmentide elektrivälja tekitamise eestKui alfabeetilisele LCD ekraanile piisab teksti kuvamiseks märkide indeksite saatmisestsiis graafilised ekraanid ise tähti ei moodusta - kõik tekstid ja pildid tuleb kasutajal ise pikselhaaval tekitada.+Monochrome graphic displays have usually passive matrixlarge color displays including computer screens have active matrix All information concerning the color of the background and the pixels of the graphic LCDs are similar to alphanumerical LCDsSimilar to the alphanumerical displays, graphic displays are also equipped with separate controllerwhich takes care of receiving information through the communication interface and generates the electrical field for the segmentsIf for alphanumerical LCD is enough to send indexes of the signs in order to display textthen  graphic displays are not capable of generating letters by themselves – all the pictures and text needs to be generated pixel by pixel by the user    
  
-===== Praktika =====+===== Practice =====
  
-Kodulabori komplekti kuulub mõõtudega 84 x 48 pikslit monokromaatiline graafiline LCD ekraanSee ekraan on sama, mida kasutatakse Nokia 3310 mobiiltelefonidesEkraani küljes on Philipsi PCD8544 kontroller, millega saab suhelda läbi SPI-taolise järjestikliideseEraldi juhitav on veel ekraanimooduli taustvalgustusEkraaniga suhtlemine pole kuigi keerulinekuid funktsioonide suure arvu tõttu pole siinkohal seda lahti seletatudKodulabori teegis on olemas funktsioonid selle kasutamiseks.+In the Home-Lab set is a 84x48 pixels monochrome graphic LCD. It is the same display as used in Nokia 3310 mobile phonesPhilips PCD8544 controller is attached to the display which can be communicated through SPI-like serial interfaceThe background lighting of the display module is separately controlledCommunicating with the display is not very difficultbut due to the large amount of the functions it is not explained hereHome-Labs library has functions for using it.
  
-Graafilise LCD teegi funktsioonid on sarnased alfabeetilise LCD omadeleEsmalt tuleb ekraan käivitada //lcd_gfx_init//-funktsioonigaPärast käivitust on soovitatav ekraan, õigemini kontrolleri mälupuhastada //lcd_gfx_clear//-funktsioonigaTeeki on sisse kirjutatud tähekaart kogu ladina tähestikunumbrite ja üldkasutatavate märkidegaTähe kõrgus on ja laius pikslitIga tähe vahe on horisontaalselt ja vertikaalselt pikslitehk kokku mahub ekraanile rida ja 14 tulpa tähtiTähe või teksti kuvamiseks tuleb eelnevalt //lcd_gfx_goto_char_xy// funktsiooniga määrata selle asukohtTähe kuvamiseks on //lcd_gfx_write_char//- ja teksti kuvamiseks //lcd_gfx_write_string//-funktsioon.+The functions of the graphic LCD are similar to the alphanumeric LCD functionsFirst, the screen must be started with // lcd_gfx_init// functionAfter start-up it is advised to clean the screenmore precisely controllers memory with the //lcd_gfx_clear// functionThere is a letter map in side of the library with full Latin alphabetnumbers and with most common signs writtenThe height of the letter is and the width of the letter is pixelsThe gap between each letter is horizontally and vertically pixelsi.e. in total it fits rows and 14 columns of lettersTo display a letter or text, first its position must be determined by using function // lcd_gfx_goto_char_xy//For displaying s letter is // lcd_gfx_write_char// function and for displaying text // lcd_gfx_write_string// function.
  
-Järgnevalt on toodud näide aja loenduri kohtaProgramm loendab sekundeid (ligikaudu), minuteid ja tundeAja tekstiks teisendamiseks on kasutusel //sprintf//-funktsioon.+The following is an example of time counterThe program counts seconds (approximately), minutes and hoursFor converting time to text //sprintf// function is used 
  
 <code c> <code c>
 // //
-// Kodulabori graafilise LCD kasutamise näide+// Example of using the graphic LCD of the HomeLab
-// LCD-le kuvatakse kellaaeg programmi algusest alates.+// Time of day is displayed on LCD since the beginning of the program.
 // //
 #include <stdio.h> #include <stdio.h>
Line 29: Line 29:
  
 // //
-// Põhiprogramm+// Main program.
 // //
 int main(void) int main(void)
Line 36: Line 36:
  char text[16];  char text[16];
  
- // LCD ekraani seadistamine+ // Set-up of the LCD.
  lcd_gfx_init();  lcd_gfx_init();
  
- // Ekraani puhastamine+ // Cleaning the screen.
  lcd_gfx_clear();  lcd_gfx_clear();
  
- // Taustavalgustuse tööle lülitamine+ // Switching on the background light.
  lcd_gfx_backlight(true);   lcd_gfx_backlight(true);
  
- // Programmi nime kuvamine+ // Displaying the name of the program.
  lcd_gfx_goto_char_xy(1, 1);  lcd_gfx_goto_char_xy(1, 1);
  lcd_gfx_write_string("Aja loendur");  lcd_gfx_write_string("Aja loendur");
  
- // Lõputu tsükkel + // Endless loop.
  while (true)  while (true)
  {  {
- // Sekundite teisendamine kellaaja kujule+ // Converting the seconds to the form of clock.
  // hh:mm:ss  // hh:mm:ss
  sprintf(text, "%02d:%02d:%02d",  sprintf(text, "%02d:%02d:%02d",
Line 59: Line 59:
  seconds % 60);  seconds % 60);
  
- // Kellaaja teksti kuvamine+ // Displaying the clock text.
  lcd_gfx_goto_char_xy(3, 3);  lcd_gfx_goto_char_xy(3, 3);
  lcd_gfx_write_string(text);  lcd_gfx_write_string(text);
   
- // Sekundi suurendamine 1 võrra+ // Adding one second.
  seconds++;  seconds++;
   
- // Riistvaraline paus 1000 millisekundit+ // Hardware delay for 1000 ms.
  hw_delay_ms(1000);  hw_delay_ms(1000);
  }  }
 } }
 </code> </code>
en/examples/display/lcd_graphic.1265634005.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0