0
Offline
Newbie
Karma: 0
Posts: 28
Arduino rocks
|
 |
« Reply #15 on: June 26, 2010, 09:39:51 am » |
I deleted the bad bit of code, but it still gave me the same error. In fact, the line it highlighted was not the Serial.print(), but the one with the sprintf(). Anyway, I am bothering you all once again to see if the great thinkers of Arduino can help out.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19003
I don't think you connected the grounds, Dave.
|
 |
« Reply #16 on: June 26, 2010, 09:48:38 am » |
Was that the sprintf with the single quotes? If not, could you repost?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 28
Arduino rocks
|
 |
« Reply #17 on: June 26, 2010, 05:19:07 pm » |
The code is the same as the last time I posted my whole program, except the 'BYTE' Serial.print(xValHex,BYTE) and Serial.print(yValHex,BYTE) has been deleted.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19003
I don't think you connected the grounds, Dave.
|
 |
« Reply #18 on: June 26, 2010, 05:23:08 pm » |
If you won't repost, I'll assume the single quotes are still there. Did you read reply #14?
|
|
|
|
« Last Edit: June 26, 2010, 05:30:53 pm by AWOL »
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 28
Arduino rocks
|
 |
« Reply #19 on: June 28, 2010, 09:49:12 am » |
Yes, the single quotes are still there. I assume that I need to chenge them to double quotes?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19003
I don't think you connected the grounds, Dave.
|
 |
« Reply #20 on: June 28, 2010, 12:18:05 pm » |
Yes, you do.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 28
Arduino rocks
|
 |
« Reply #21 on: June 28, 2010, 06:33:21 pm » |
Thanks! For once the compiler didn't come up with an error. Now I can finally begin the real programming. 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 28
Arduino rocks
|
 |
« Reply #22 on: July 04, 2010, 10:34:08 am » |
As my mom might have said, "Don't count your chickens before they hatch." I tried out the code and, even though there was no error detected by the compiler, nothing appeared on the screen of the LCD. Any suggestions?
|
|
|
|
|
Logged
|
|
|
|
|
Knivsta,Sweden
Offline
Sr. Member
Karma: 0
Posts: 274
Low level's cool
|
 |
« Reply #23 on: July 04, 2010, 02:08:52 pm » |
char xValHex[4]; char yValHex[4];
Make those 5 bytes long, so they'll have room for the terminating zero-byte.
|
|
|
|
« Last Edit: July 04, 2010, 05:23:06 pm by drhex »
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19003
I don't think you connected the grounds, Dave.
|
 |
« Reply #24 on: July 04, 2010, 05:10:00 pm » |
Did your mom ever tell you that it's useful if you post your code, 'cos very few of us are psychic?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 28
Arduino rocks
|
 |
« Reply #25 on: July 07, 2010, 09:45:24 am » |
Here's my code: (After I took drhex's advice) #define TO_HEX(x) (((x) > 10) ? (x) - 10 + 'A' : (x) + '0') byte xVal = 64; byte yVal = 32; char xValHex[5]; char yValHex[5];
void setup(){ sprintf(yValHex,"0x%c%c", TO_HEX (yVal >> 4), TO_HEX (yVal & 15)); sprintf(xValHex,"0x%c%c", TO_HEX (xVal >> 4), TO_HEX (xVal & 15)); Serial.begin(9600); Serial.print(0x7C,BYTE);//cmd Serial.print(0x02,BYTE);//backlight Serial.print(0x19,BYTE);//set to 25 } void loop(){ Serial.print(0x7C,BYTE);//cmd Serial.print(0x03,BYTE);//circle Serial.print(xValHex);//x-coord Serial.print(yValHex);//y-coord Serial.print(0x0A,BYTE);//radius ten Serial.print(0x01,BYTE);//draw }
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 28
Arduino rocks
|
 |
« Reply #26 on: July 11, 2010, 09:21:50 am » |
Hello? Anybody got some advice? I posted my code.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19003
I don't think you connected the grounds, Dave.
|
 |
« Reply #27 on: July 11, 2010, 10:02:23 am » |
You're the one with the hardware - what steps have you taken to debug?
I'd be inclined to use the serial monitor rather than unproven LCD hardware, at least until you've proven that the messages you need are ebing sent and received, at the correct rate and in the expected format.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 28
Arduino rocks
|
 |
« Reply #28 on: July 11, 2010, 10:48:40 am » |
I tried the serial monitor and I think I've found the problem. When It sends the information that sets the backlight value, it comes up on the serial monitor as funky symbols, but when It sends the hex information, it comes up as readable letters. If I am correct (which I'm probably not) it's the result of the "BYTE" format being removed from the Serial.print() command. Any suggestions? (Honestly, I haven't done much to debug. I only checked the connections and ran it through the compiler a couple times.) In case you're wondering, my code is still the same.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 28
Arduino rocks
|
 |
« Reply #29 on: July 17, 2010, 09:28:02 am » |
Does anyone have some advice? I'm still confused!
|
|
|
|
|
Logged
|
|
|
|
|
|