Autor Tema: Pude hacer funcionar una LCD gráfica  (Leído 5002 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado PalitroqueZ

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 5474
    • Electrónica Didacta
Pude hacer funcionar una LCD gráfica
« en: 24 de Mayo de 2006, 13:40:30 »
Hola amigos foreros, gracias a unas librerias que trae el CCS, pude hacer funcionar una lcd gráfica que trae el proteus



y el código

   #include <16F877.h>
   #include <HDM64GS12.c>
   #include <graphics.c>

   #use delay(clock=20000000) 
//***************************************************************
// FORMA PARTE DE LA LIBRERIA GLCD.C
////  glcd_init(mode)                                                ////
////     * Must be called before any other function.                 ////
////       - mode can be ON or OFF to turn the LCD on or off         ////
////                                                                 ////
////  glcd_pixel(x,y,color)                                          ////
////     * Sets the pixel to the given color.                        ////
////       - color can be ON or OFF                                  ////
////                                                                 ////
////  glcd_line(x1,y1,x2,y2,color)                                   ////
////     * Draws a line from the first point to the second point     ////
////       with the given color.                                     ////
////       - color can be ON or OFF                                  ////
////                                                                 ////
////  glcd_rect(x1,y1,x2,y2,fill,color)                              ////
////     * Draws a rectangle with upper left point (x1,y1) and lower ////
////       right point (x2,y2).                                      ////
////       - fill can be YES or NO                                   ////
////       - color can be ON or OFF                                  ////
////                                                                 ////
////  glcd_bar(x1,y1,x2,y2,width,color)                              ////
////     * Draws a bar (wide line) from the first point to the       ////
////       second point.                                             ////
////       - width is the number of pixels wide                      ////
////       - color is ON or OFF                                      ////
////                                                                 ////
////  glcd_circle(x,y,radius,fill,color)                             ////
////     * Draws a circle with center at (x,y)                       ////
////       - fill can be YES or NO                                   ////
////       - color can be ON or OFF                                  ////
////                                                                 ////
////  glcd_text57(x,y,textptr,size,color)                            ////
////     * Write the null terminated text pointed to by textptr with ////
////       the upper left coordinate of the first character at (x,y).////
////       Characters are 5 pixels wide and 7 pixels tall.           ////
////       - size is an integer that scales the size of the text     ////
////       - color is ON or OFF                                      ////
////     * Note - The given text is character wrapped. If this       ////
////       function is used on a different size display, then change ////
////       the GLCD_WIDTH define appropriately.                      ////
////                                                                 ////
////  glcd_fillScreen(color)                                         ////
////     * Fills the entire LCD with the given color.                ////
////       - color can be ON or OFF                                  ////
//***************************************************************


//***************************************************************
// FORMA PARTE DE LA LIBRERIA HDM64GS12.c
////  glcd_init(mode)                                                ////
////     * Must be called before any other function.                 ////
////       - mode can be ON or OFF to turn the LCD on or off         ////
////                                                                 ////
////  glcd_pixel(x,y,color)                                          ////
////     * Sets the pixel to the given color.                        ////
////       - color can be ON or OFF                                  ////
////                                                                 ////
////  glcd_fillScreen(color)                                         ////
////     * Fills the entire LCD with the given color.                ////
////       - color can be ON or OFF                                  ////
////                                                                 ////
////  glcd_update()                                                  ////
////     * Write the display data stored in RAM to the LCD           ////
////     * Only available if FAST_GLCD is defined                    ////
//********************************************************************************

// FORMA PARTE DE LA LIBRERIA graphics.c
////  glcd_line(x1, y1, x2, y2, color)                               ////
////     * Draws a line from the first point to the second point     ////
////       with the given color                                      ////
////       - color can be ON or OFF                                  ////
////                                                                 ////
////  glcd_rect(x1, y1, x2, y2, fill, color)                         ////
////     * Draws a rectangle with one corner at point (x1,y1) and    ////
////       the other corner at point (x2,y2)                         ////
////       - fill can be YES or NO                                   ////
////       - color can be ON or OFF                                  ////
////                                                                 ////
////  glcd_bar(x1, y1, x2, y2, width, color)                         ////
////     * Draws a bar (wide line) from the first point to the       ////
////       second point                                              ////
////       - width is the number of pixels wide                      ////
////       - color is ON or OFF                                      ////
////                                                                 ////
////  glcd_circle(x, y, radius, fill, color)                         ////
////     * Draws a circle with center at (x,y)                       ////
////       - fill can be YES or NO                                   ////
////       - color can be ON or OFF                                  ////
////                                                                 ////
////  glcd_text57(x, y, textptr, size, color)                        ////
////     * Write the null terminated text pointed to by textptr with ////
////       the upper left coordinate of the first character at (x,y) ////
////       Characters are 5 pixels wide and 7 pixels tall            ////
////       - size is an integer that scales the size of the text     ////
////       - color is ON or OFF                                      ////
////     * Note - This function wraps characters to the next line    ////
////              use #define GLCD_WIDTH to specify a display width  ////
//*****************************************************************************************

//para la pantalla usada max resolucion=(190,,ON)
   void  main(){
   int t;
   char  voltText[] = "PalitroqueZ";
   char segunda[] = "  TODOPIC";

   glcd_init(ON);
s:   glcd_text57(30, 25, voltText, 1, on);
   glcd_text57(30, 35, segunda, 1, on);
   delay_ms(100);
   glcd_fillScreen(ON);
   glcd_text57(30, 25, voltText, 1, off);
   glcd_text57(30, 35, segunda, 1, off);
   delay_ms(100);
   glcd_fillScreen(OFF);
   goto   s;
}

el adjunto con todo:

La propiedad privada es la mayor garantía de libertad.
Friedrich August von Hayek

Desconectado marturetjulio

  • PIC10
  • *
  • Mensajes: 44
Re: Pude hacer funcionar una LCD gráfica
« Respuesta #1 en: 29 de Agosto de 2009, 17:56:54 »
hola amigo gracias por postear tu trabajo aqui. bueno queria decirte que copie el ejemplo que colocaste y lo conecte igual en proteus identicamente y no me funciona, no sale en la pantalla lo que escribiste en el programa. yo pienso que las librerias que tengo de grafics.c y la de HDM64GS12.c no son las mismas que tienes en tu ccs y por eso no corre  pero si me puedes ayudar
Expeciencia es simplemente el nombre que le damos a nuestros errores!!!

Desconectado ASTROCAR

  • PIC24F
  • *****
  • Mensajes: 664
Re: Pude hacer funcionar una LCD gráfica
« Respuesta #2 en: 29 de Agosto de 2009, 18:58:39 »
hola buenas tardes, yo en una oportunidad tambien probe ese ejemplo del colega y no me funciono de principio y resulto que no estaban declarados los fuses del pic  luego que se los coloque me funciono sin problema alguno.

Saludos y espero puedas resolver ojo yo lo monte en fisico en proteus no lo probe.

Atten.
Alexander Santana.
Venezuela-Barcelona.
EL APRENDER ES NADA; MEJOR ES COMPARTIR EL APRENDIZAJE


 

anything