Differences

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

Link to this comparison view

Next revision
Previous revision
et:examples:display:lcd_graphic:character_map [2010/11/02 22:33] – tekitatud raivo.sellet: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);
  
 +    }
 +}
 +</code>
 +
 +
 +Potentsiomeetriga märgi valimine
 +
 +<code c>
 +#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);
     }     }
 } }
 </code> </code>
et/examples/display/lcd_graphic/character_map.1288737181.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