Go Down

Topic: Problem with Sample sketch (Read 3851 times) previous topic - next topic

Metalfan1185

I downloaded the t6963c library from the collection here and tried to compile the sample sketch and this is the result.



ive been playing with ) and ;'s like crazy to fix this syntax thing lol

CrossRoads

If you put the cursor just to the right of a ) or }, it will highlight the mating ( or {.
Looks like that line is just missing a ( after the =
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

liudr

What is the original line before you tried to change it? You should use the "#" button to post code, not a screen shot.

wyager

Lol.... Missing a "(" before the "(_FW-1)..."

Metalfan1185

I posted a screen shot so you could see the error.  I added parenthesis as you mentioned but still the same error, i know for every open ( there has to be a close ) but no matter what I add thats the result.  The error I posted is direct from the library, I have not modifyed it at all.  I just tried to compile it and it wont work.  After trying a bunch of things I closed it and opened the original one that was saved and posted the screenshot of it here.

Thanks for your responses.  I reciveved a new t6963c GLCD and im dying to try it out lol

Federico

Look, some line before the error there is another line commented //lsb direction correction wich is the same minus one ). You should try to write the line that works.
Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

Staedtler

#6
Jan 31, 2011, 12:12 am Last Edit: Jan 31, 2011, 12:32 am by Staedtler Reason: 1


OK, I got it!


Change:

Code: [Select]

// ------------------------------------------------------
// Set a single pixel at x,y (in pixels) to 0 (off)
// ------------------------------------------------------
byte T6963::clearPixel (byte x, byte y) {


For:

Code: [Select]

// ------------------------------------------------------
// Set a single pixel at x,y (in pixels) to 0 (off)
// ------------------------------------------------------
byte T6963::clearPixel (byte x, byte y) (


Basically, change the "{" for "(" !!!!!

and delete the extra ")" on the "tmp" line ...

Code: [Select]

(_FW-1) - (x%_FW));


for

Code: [Select]

(_FW-1) - (x%_FW);



and next time for God sake paste the code!!!

You are welcome.
--------------------------------------
Eight bytes walk into a bar. The bartender asks, 'Can I get you anything?'
- 'Yeah', reply the bytes

Metalfan1185

i fixed it as you stated and now it says theres a problem with the "Byte tmp" line.  I figured example sketches should run right off the bat.  I hate to bother you guys with things that are simple but im kinda new and learning how these libraries work.

sometimes when I get the errors at the bottom of the screen I have no idea what they mean lol

heres some code

Code: [Select]
//-------------------------------------------------------------------------------------------------
byte T6963::clearPixel(byte x, byte y)(
  byte tmp=B11110000;
  tmp |= (_FW-1)-(x%_FW); //LSB Direction Correction
  writeCommand(tmp);
  return tmp;
}
//------------------

Staedtler


i fixed it as you stated and now it says theres a problem with the "Byte tmp" line.  I figured example sketches should run right off the bat.  I hate to bother you guys with things that are simple but im kinda new and learning how these libraries work.

sometimes when I get the errors at the bottom of the screen I have no idea what they mean lol

heres some code

Code: [Select]
//-------------------------------------------------------------------------------------------------
byte T6963::clearPixel(byte x, byte y)(
  byte tmp=B11110000;
  tmp |= (_FW-1)-(x%_FW); //LSB Direction Correction
  writeCommand(tmp);
  return tmp;
}
//------------------




can you paste the new error?
--------------------------------------
Eight bytes walk into a bar. The bartender asks, 'Can I get you anything?'
- 'Yeah', reply the bytes

CrossRoads

Isn't it fairly obvious there is an extra ( at the end of  the line?

byte T6963::clearPixel(byte x, byte y)(

or maybe it should be {
to match up with this one?
  return tmp;
}

Either or get rid of the mismatched ( and }
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Staedtler

#10
Feb 01, 2011, 03:23 am Last Edit: Feb 01, 2011, 03:26 am by Staedtler Reason: 1
He forgot the "SetAdressPointer" line.

This should work:

Code: [Select]


// ------------------------------------------------------
// Set a single pixel at x,y (in pixels) to 0 (off)
// ------------------------------------------------------
byte T6963::clearPixel (byte x, byte y) (
 SetAddressPointer((_GH + (x / _FW) + (_GA * y)));
 byte tmp=B11111000;
 tmp |= (_FW-1)-(x%_FW); //LSB Direction Correction
 writeCommand(tmp);
 return tmp;
 )
 
// ------------------------------------------------------
 
--------------------------------------
Eight bytes walk into a bar. The bartender asks, 'Can I get you anything?'
- 'Yeah', reply the bytes

Staedtler

Quote
sometimes when I get the errors at the bottom of the screen I have no idea what they mean lol


They actually tells you exactly what is going on.
Try to pay attention on what the error message says.
--------------------------------------
Eight bytes walk into a bar. The bartender asks, 'Can I get you anything?'
- 'Yeah', reply the bytes

Metalfan1185

ok, I changed it like the last post and the error now says "Function 'byte T6963::clearPixel(byte, byte)' is initialized like a variable"

code:

Code: [Select]
// ------------------------------------------------------
// Set a single pixel at x,y (in pixels) to 0 (off)
// ------------------------------------------------------
byte T6963::clearPixel (byte x, byte y) (
  SetAddressPointer((_GH + (x / _FW) + (_GA * y)));
  byte tmp=B11111000;
  tmp |= (_FW-1)-(x%_FW); //LSB Direction Correction
  writeCommand(tmp);
  return tmp;
  )
 
// ------------------------------------------------------

Metalfan1185

I do pay attention to the errors lol I'm new to C and i'm still learning the syntax.  I understand that if you arrow key over the brackets and parenthesis you it points out their mates (great feature)

has anyone else used this library for a t6963c display before? am I the only one having this issue?

Staedtler

#14
Feb 02, 2011, 07:28 pm Last Edit: Feb 02, 2011, 07:57 pm by Staedtler Reason: 1
Looks like you need to use brackets instead parenthesis, but a short junk of code is difficult to debug.

Since you didn't had any error until that line, I was duplicating the code used on ""// Set a single pixel at x,y (in pixels) to 1 (on)".

I think you have to dump all the code in one post to understand it.


Edit: I've found the library. Is a mess, and is not debugged.
Let me check if I get somewhere.

--------------------------------------
Eight bytes walk into a bar. The bartender asks, 'Can I get you anything?'
- 'Yeah', reply the bytes

Go Up