This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| et:examples:display:lcd_graphic:character_map [2010/11/02 22:33] – tekitatud raivo.sell | et:examples:display:lcd_graphic:character_map [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 34: | Line 34: | ||
| sw_delay_ms(500); | sw_delay_ms(500); | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | Potentsiomeetriga märgi valimine | ||
| + | |||
| + | <code c> | ||
| + | #include < | ||
| + | #include < | ||
| + | #include < | ||
| + | |||
| + | // | ||
| + | // Põhiprogramm | ||
| + | // | ||
| + | int main(void) | ||
| + | { | ||
| + | unsigned short value; | ||
| + | char text[16]; | ||
| + | |||
| + | // LCD ekraani seadistamine | ||
| + | lcd_gfx_init(); | ||
| + | lcd_gfx_clear(); | ||
| + | |||
| + | // Taustavalgustuse tööle lülitamine | ||
| + | lcd_gfx_backlight(true); | ||
| + | |||
| + | // Programmi nime kuvamine | ||
| + | lcd_gfx_goto_char_xy(1, | ||
| + | lcd_gfx_write_string(" | ||
| + | | ||
| + | // ADC muunduri seadistamine | ||
| + | adc_init(ADC_REF_AVCC, | ||
| + | |||
| + | // Lõputu tsükkel | ||
| + | while (true) | ||
| + | { | ||
| + | value = adc_get_average_value(3, | ||
| + | | ||
| + | value=value/ | ||
| + | sprintf(text, | ||
| + | |||
| + | // Teksti kuvamine LCD teise rea alguses | ||
| + | lcd_gfx_goto_char_xy(1, | ||
| + | lcd_gfx_write_string(text); | ||
| } | } | ||
| } | } | ||
| </ | </ | ||