Pages: [1] 2   Go Down
Author Topic: Problem with Sample sketch  (Read 3012 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 107
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 =
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6937
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


0
Offline Offline
Full Member
***
Karma: 5
Posts: 200
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 107
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Milano, Italy
Offline Offline
Faraday Member
**
Karma: 10
Posts: 3085
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

Dallas, TX
Offline Offline
Jr. Member
**
Karma: 5
Posts: 91
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



OK, I got it!


Change:

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

For:

Code:
// ------------------------------------------------------
// 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:
(_FW-1) - (x%_FW));

for

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


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

You are welcome.
« Last Edit: January 30, 2011, 06:32:45 pm by Staedtler » Logged

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 107
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
//-------------------------------------------------------------------------------------------------
byte T6963::clearPixel(byte x, byte y)(
  byte tmp=B11110000;
  tmp |= (_FW-1)-(x%_FW); //LSB Direction Correction
  writeCommand(tmp);
  return tmp;
}
//------------------
Logged

Dallas, TX
Offline Offline
Jr. Member
**
Karma: 5
Posts: 91
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
//-------------------------------------------------------------------------------------------------
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?
Logged

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 }
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Dallas, TX
Offline Offline
Jr. Member
**
Karma: 5
Posts: 91
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

He forgot the "SetAdressPointer" line.

This should work:

Code:

// ------------------------------------------------------
// 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;
  )
  
 // ------------------------------------------------------
  
« Last Edit: January 31, 2011, 09:26:26 pm by Staedtler » Logged

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

Dallas, TX
Offline Offline
Jr. Member
**
Karma: 5
Posts: 91
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 107
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
// ------------------------------------------------------
// 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;
  )
 
 // ------------------------------------------------------
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 107
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Dallas, TX
Offline Offline
Jr. Member
**
Karma: 5
Posts: 91
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

« Last Edit: February 02, 2011, 01:57:34 pm by Staedtler » Logged

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

Pages: [1] 2   Go Up
Jump to: