GLCD Tutorial

achei por ai esse tutorial sobre lcd gráfico...
site:
http://www.hobbypic.com/index.php?option=com_content&task=view&id=15&Itemid=37
Download:
http://www.hobbypic.com/images/stories/articulos/displays/gclcd/gclcd.zip
site:
http://www.hobbypic.com/index.php?option=com_content&task=view&id=15&Itemid=37


Download:
http://www.hobbypic.com/images/stories/articulos/displays/gclcd/gclcd.zip
- Código: Selecionar todos
#include <18F2520.h>
#fuses NOWDT, WDT128, H4, NOPROTECT, BROWNOUT, BORV45, NOPUT, NOCPD
#fuses NOSTVREN, NODEBUG, NOLVP, NOWRT, NOWRTD, NOIESO, NOFCMEN, NOPBADEN
#fuses NOWRTC, NOWRTB, NOEBTR, NOEBTRB, NOCPB, NOLPT1OSC, MCLR, NOXINST
#use delay(clock=40000000) // usar cristal 10Mhz, pll*4 activado (fuse H4)
#use RS232(BAUD=9600, BITS=8, PARITY=N, XMIT=PIN_C6, RCV=PIN_C7)
#include <Arial9.c>
#include <ground.c>
#include <gclcd.h>
#byte pb =0xF81
#bit t_mas =pb.1 // RB1, pin22
#bit t_mns =pb.2 // RB2, pin23
void main(void)
{
unsigned int8 contraste = 65;
setup_adc_ports(NO_ANALOGS);
gclcd_init(); // Inicialización GCLCD
// Prueba funciones gráficas
gclcd_rect(5,5,125,125,3,0,BLACK);
gclcd_rect(10,20,45,110,1,1,RED);
gclcd_circle(45,60,30,1,1,YELLOW);
gclcd_circle(80,40,30,1,0,GREEN);
gclcd_line(80,40,100,65,GREEN);
// Prueba Caracteres
gclcd_font();
gclcd_color(BLUE);
gclcd_gotoxy(9,10);
printf(gclcd_putc,"GCLCD v0.5");
gclcd_color(RED);
gclcd_gotoxy(35,50);
printf(gclcd_putc,"por J1M");
// Prueba imagen 64k
gclcd_img(55,70);
while (true) // Variamos el contraste
{
if (!t_mas){delay_ms(300); contraste++; if(contraste>100){contraste=100;}; gclcd_contrast(contraste);}
else if (!t_mns){delay_ms(300); contraste--; if(contraste==255){contraste=0;}; gclcd_contrast(contraste);}
}
}