#include <stdio.h>
#include <homelab/delay.h>
#include <homelab/module/lcd_gfx.h>
 
//
// Põhiprogramm
//
int main(void)
{
    signed short number=0;   
 
    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, 1);
    lcd_gfx_write_string("Charecter map");
 
    // Lõputu tsükkel
    while (true)
    {
        sprintf(text, "%i - %c ", number, number);
        // Teksti kuvamine LCD teise rea alguses
        lcd_gfx_goto_char_xy(1, 2);
        lcd_gfx_write_string(text);
        number++;
        sw_delay_ms(500);
 
    }
}

Potentsiomeetriga märgi valimine

#include <stdio.h>
#include <homelab/adc.h>
#include <homelab/module/lcd_gfx.h>
 
//
// 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, 1);
    lcd_gfx_write_string("Pote tekst");
 
    // ADC muunduri seadistamine
    adc_init(ADC_REF_AVCC, ADC_PRESCALE_8);
 
    // Lõputu tsükkel
    while (true)
    {
        value = adc_get_average_value(3, 4);
 
        value=value/10+25;
        sprintf(text, "%i - %c ", value, value);
 
        // Teksti kuvamine LCD teise rea alguses
        lcd_gfx_goto_char_xy(1, 2);
        lcd_gfx_write_string(text);
    }
}
et/examples/display/lcd_graphic/character_map.txt · Last modified: 2020/07/20 09:00 by 127.0.0.1
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