|
|
View previous topic :: View next topic |
Author |
Message |
Gill
Joined: 12 Jul 2015 Posts: 6
|
Error reporting in graphics.c |
Posted: Thu Mar 09, 2017 11:15 am |
|
|
Hello everyone,
Can someone help for this reason?
In an attempt to fill with the code to manage ccs_pcwhd_v4.084 lcd t6963c, I receive error:
12 "c: \ picc \ drivers \ graphics, c" line 531 (22,32) undefined identifer glcd_width.
Thanks to the availability
Code: |
if(x+5*size >= GLCD_WIDTH) // Performs character wrapping
{
x = 0; // Set x at far left position
y += 7*size + 1; // Set y at next position down
}
for(j=0; j<5; ++j, x+=size) // Loop through character byte data
{
for(k=0; k < 7; ++k) // Loop through the vertical pixels
{
if(bit_test(pixelData[j], k)) // Check if the pixel should be set
{
for(l=0; l < size; ++l) // These two loops change the
{ // character's size
for(m=0; m < size; ++m)
{
glcd_pixel(x+m, y+k*size+l, color); // Draws the pixel
}
}
}
}
}
|
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Mar 09, 2017 12:13 pm |
|
|
It tells you what to do:
Quote: | //// * Note - This function wraps characters to the next line ////
//// use #define GLCD_WIDTH to specify a display width //// |
Add a line to define the graphic lcd width in pixels. Example:
Code: | #define GLCD_WIDTH 128 |
Put it at the top of the graphics.c file, or more usually, put it in the file
that #include's graphics.c, and put it above the #include line. |
|
|
Gill
Joined: 12 Jul 2015 Posts: 6
|
|
Posted: Fri Mar 10, 2017 12:33 pm |
|
|
THANKS YOU FOR YOUR QUICK REPLY.
reset error, but a new problem: the display remains blank, attach code to help.
thank you
Code: |
////////////////////////////////////////////////// ///////////////////////
//// ////
//// Connections are as follows: ////
//// / EC - - C3 ////
//// / WR - - C4 ////
//// / RD - - C5 ////
//// C / D - - C6 ////
//// / RSt- - C7 ////
//// DATA0-7 - - PORTD0-7 ////
//// LCD's FS is tied low (FS = 0 is 8x8 font) ////
//// ////
////////////////////////////////////////////////// ///////////////////////
#define GLCD_WIDTH 128
#include <18f452.h>
#device adc = 10
#device * = 16
#include <t6963c_2.c> //
#include <graphics.c>
#fuses NOWDT, HS, NOPUT, PROTECT, brownout, NOLVP, NOCPD, NOWRT, NODEBUG
#use delay (clock = 20000000)
int adc = 0, adc_old = 0;
#inline
void logo ()
{
giris1 char [] = "deneme";
giris2 char [] = "IRFAN Percin";
giris3 char [] = "irfanpercin ........";
glcd_text57 (12,12, giris2, 3, ON);
glcd_text57 (62,45, giris1, 3, ON);
delay_ms (1000);
glcd_box (10,10,230,80, ON); // Dolgu koyu renk
glcd_text57 (12, 12, giris2, 3, Off);
glcd_text57 (62,45, giris1, 3, Off);
delay_ms (1000);
// Glcd_box (10,10,230,80, Off); // Dolgu açık renk
glcd_square (10,95,220,110, on); // bar
glcd_text57 (42, 98, giris3, 1, ON);
glcd_pixel (239.127, on); //
glcd_pixel (1,127, on); //
glcd_pixel (1.1, on); // Köşelere tek pixel test notes
glcd_pixel (239.1, on); //
}
#inline
ADCD void ()
{
int digits [4];
set_adc_channel (1);
adc read_adc = ();
// Clear_screen (); // Sadece adc gör
for (;;)
{
glcd_text57 (100.118, digit, 1, ON);
adc read_adc = ();
if (adc! = adc_old)
{
glcd_text57 (100, 118, digit, 1, OFF);
}
adc_old = adc;
sprintf (digits, "% 03U", ADC);
glcd_square (95,115,120,127, on);
}
}
#inline
void main ()
{
setup_adc (ADC_CLOCK_INTERNAL);
setup_adc_ports (AN0);
delay_ms (10);
set_tris_c (0x00); // Graphic lcd control lines all output
glcd_init (); // Initialization
glcd_WriteByte (2, (LCDModeSet | LCDMode_XOR)); // XOR-Mode .................. (??????)
glcd_WriteByte (1, (LCDDispMode | LCDDisp_TXT | LCDDisp_GRH)); // Text and Graphic Mode
delay_ms (1);
logo();
ADCD ();
} |
Google Traduttore per il Business:Translator ToolkitTraduttore di siti webStrumento a supporto dell'export |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Fri Mar 10, 2017 1:49 pm |
|
|
Seriously you need to actually start to learn how to debug.
Do _one thing at a time_.
First test your PIC is actually running (flash an LED test).
Then smallest code to clear the screen and set just one point on the display.
If this doesn't work, the odds are you have a fault in how you are connecting things.
Once you have the display working, only then move on to drawing more complex shapes etc.
XOR means 'invert' bits where lines cross etc.. Is this what you want?.
ADC_CLOCK_INTERNAL, is not recommended above 1MHz.
Most LCD's need _time_ after they are switched on before you can talk to them.
Main code cannot be 'inline'. What on earth can it be inline 'to'?.
As shown your code drops off the end. Chip will go to sleep and stop when this happens...
An0, is ADC channel 0, not 1....
So many obvious errors.
Go back to the start, and start taking single steps, not trying to run before you can even crawl. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Fri Mar 10, 2017 1:55 pm |
|
|
while I don't use that GLCD this..
glcd_text57 (100.118, digit, 1, ON);
doesn't look correct to me.
Then there's the old 5V PIC, 3V GLCD we haven't discussed.... |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|