This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:software:homelab:library:module:lcd_graphic [2010/02/08 14:42] – mikk.leini | en:software:homelab:library:module:lcd_graphic [2020/07/20 12:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | //Seotud mooduliga: [HW] [[en: | + | //Related to: [HW] [[en: |
| - | See teegi osa sisaldab kodulabori graafilise | + | This library contains functions to use the HomeLab graphical |
| - | ===== Funktsioonid | + | ===== Functions |
| - | * **//void lcd_gfx_init(void)// | + | * **//void lcd_gfx_init(void)// |
| + | Intializes LCD. | ||
| - | * **//void lcd_gfx_backlight(bool set)//** \\ Ekraani taustvalgustuse lülitamine. Parameetrid: | + | * **//void lcd_gfx_backlight(bool set)//** \\ |
| - | * //set// - Tõeväärtus taustvalgustuse töötamisest. | + | Switch LCD backlight on or off. Parameters: |
| + | * //set// - // | ||
| - | * **//void lcd_gfx_clear(void)// | + | * **//void lcd_gfx_clear(void)// |
| + | Clears a whole display. | ||
| - | * **//void lcd_gfx_clear_line(unsigned char line)//** \\ Ekraani ühe tekstirea kustutamine. Parameetrid: | + | * **//void lcd_gfx_clear_line(unsigned char line)//** \\ |
| - | * //line// - Rea number 0 kuni 5. | + | Clears a single text line. Parameters: |
| + | * //line// - Line number. 0 to 5. | ||
| - | * **//void lcd_gfx_goto_char_xy(unsigned char x, unsigned char y)// | + | * **//void lcd_gfx_goto_char_xy(unsigned char x, unsigned char y)// |
| - | * //x// - X koordinaat. Väärtus | + | Selects a position to write text to. Parameters: |
| - | * //y// - Y koordinaat. Väärtus | + | * //x// - X coordinate. 0 to 13. |
| + | * //y// - Y coordinate. 0 to 5. | ||
| - | * **//void lcd_gfx_write_char(char c)//** \\ Sümboli kuvamine ekraanil eelnevalt määratud positsioonil. Parameetrid: | + | * **//void lcd_gfx_write_char(char c)//** \\ |
| - | * //c// - ASCII sümbol. | + | Writes a character to the pre-defined position. Parameters: |
| + | * //c// - ASCII character. | ||
| - | * **//void lcd_gfx_write_string(char *s)//** \\ Teksti kuvamine ekraanil eelnevalt määratud positsioonist alates. Parameetrid: | + | * **//void lcd_gfx_write_string(char *s)//** \\ |
| - | * //s// - Teksti viit. | + | Writes a string to the display starting from the pre-defined position. Parameters: |
| + | * //s// - Pointer to string (char array). | ||
| - | ===== Näide | + | ===== Example |
| + | |||
| + | Demonstration of using a graphical LCD. | ||
| <code c> | <code c> | ||
| Line 34: | Line 43: | ||
| int main(void) | int main(void) | ||
| { | { | ||
| - | // Ekraani seadistamine | + | // LCD initialization. |
| lcd_gfx_init(); | lcd_gfx_init(); | ||
| - | // LCD ekraani puhastamine | + | // Display clearing. |
| lcd_gfx_clear(); | lcd_gfx_clear(); | ||
| - | // Kursori (nähtamatu) ekraani keskele viimine | + | // Cursor to the middle of the screen. |
| lcd_gfx_goto_char_xy(5, | lcd_gfx_goto_char_xy(5, | ||
| - | // Teksti kuvamine | + | // Displaying a text. |
| - | lcd_gfx_write_string(" | + | lcd_gfx_write_string(" |
| } | } | ||
| </ | </ | ||