Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Link zu dieser Vergleichsansicht
dogs102w-6_lcd [2015/03/12 01:02] Claus Kühnel |
dogs102w-6_lcd [2015/03/12 01:13] (aktuell) Claus Kühnel |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
===== EA DOGS102W-6 LCD ===== | ===== EA DOGS102W-6 LCD ===== | ||
- | Grüne Hintergrundbeleuchtung mit veränderlichem Kontrast{{ :lcd-3.png?350|}} | + | **Grüne Hintergrundbeleuchtung mit veränderlicher Helligkeit**{{ :lcd-3.png?350|}} |
Demoprogramm: | Demoprogramm: | ||
Zeile 14: | Zeile 14: | ||
#include <font_8x8.h> | #include <font_8x8.h> | ||
#include <logo_BLH.h> | #include <logo_BLH.h> | ||
- | |||
- | /*Available functions in dog_1701 Libraray: | ||
- | void initialize (byte p_cs, byte p_si, byte p_clk, byte p_a0, byte p_res, byte type); | ||
- | void clear (void); | ||
- | void contrast (byte contr); | ||
- | void view (byte direction); | ||
- | void string (byte column, byte page, const byte *font_adress, const char *str); | ||
- | void rectangle (byte start_column, byte start_page, byte end_column, byte end_page, byte pattern); | ||
- | void picture (byte column, byte page, const byte *pic_adress); | ||
- | */ | ||
dog_1701 DOG; | dog_1701 DOG; | ||
- | //the following port definitions are used by our demo board "EA PCBARDDOG7565" | + | //the following port definitions are used by the demo board "EA PCBARDDOG7565" |
int led = 3; | int led = 3; | ||
int led_green = 5; | int led_green = 5; | ||
int led_red = 3; | int led_red = 3; | ||
- | unsigned char i = 0; | + | |
+ | unsigned char bl = 0; | ||
char buffer[10]; | char buffer[10]; | ||
+ | |||
void init_backlight(boolean mono); | void init_backlight(boolean mono); | ||
void mono_backlight(byte brightness); | void mono_backlight(byte brightness); | ||
Zeile 46: | Zeile 38: | ||
} | } | ||
- | //create a sample sceen content | + | //create a sample sceen content with string and number output |
void sample_screen(void) | void sample_screen(void) | ||
{ | { | ||
DOG.clear(); //clear whole display | DOG.clear(); //clear whole display | ||
DOG.picture(0,0,ea_logo); | DOG.picture(0,0,ea_logo); | ||
- | DOG.string(71,0,font_8x16,"DOGS"); //font size 8x16 first page | + | DOG.string(71,0,font_8x16,"DOGS"); //font size 8x16 first page |
DOG.rectangle(71,2,127,2,0x03); //show small line (filled pattern = 0x03), to the left and right of 'DOGL128' | DOG.rectangle(71,2,127,2,0x03); //show small line (filled pattern = 0x03), to the left and right of 'DOGL128' | ||
DOG.string(0,3,font_6x8,"-3.3V single sup."); | DOG.string(0,3,font_6x8,"-3.3V single sup."); | ||
Zeile 57: | Zeile 49: | ||
DOG.string(0,5,font_6x8,"-LED backlights"); | DOG.string(0,5,font_6x8,"-LED backlights"); | ||
DOG.string(0,6,font_6x8,"-extrem low power"); | DOG.string(0,6,font_6x8,"-extrem low power"); | ||
- | DOG.string(0,7,font_6x8,"Contrast = "); | + | DOG.string(0,7,font_6x8,"Backlight = "); |
- | snprintf(buffer, sizeof(buffer), "%3i", i); | + | snprintf(buffer, sizeof(buffer), "%3i", bl); |
- | DOG.string(66,7,font_6x8,buffer); | + | DOG.string(72,7,font_6x8,buffer); |
} | } | ||
Zeile 65: | Zeile 57: | ||
void loop() | void loop() | ||
{ | { | ||
- | // rgb_backlight(random(255), random(255)); //BL random color (green, red) | + | rgb_backlight(bl, 0); //controls the brightness of green led only |
- | rgb_backlight(i, 0); | + | |
DOG.view(VIEW_BOTTOM); //default viewing direction | DOG.view(VIEW_BOTTOM); //default viewing direction | ||
sample_screen(); //show content | sample_screen(); //show content | ||
- | i += 16; | + | bl += 16; |
delay(500); | delay(500); | ||
} | } |