Hi again.
I'm hoping that this will be solved with a similarly well-put "WTF are you doing?" comment as last time.
I've started to get the hang of laying my information out on the screen, using the sprintf command.
However, I'm getting weird results.
If I put in the following:
sprintf(revs,"%.5d",rpm);
sprintf(date,"%.2d/%.2d/%d",now.day(),now.month(),now.year());
sprintf(time,"%.2d:%.2d",now.hour(),now.minute());
glcd.drawstring(92,0,(revs));
glcd.drawstring(67,6,(date));
glcd.drawstring(97,7,(time));
It's perfectly happy for a second or so after uploading to the board, as evidenced here:
However, after a short pause, it then becomes this:
I don't know why, but I'm hoping that someone will point out something really obvious (read: worthy of a facepalm) and it'll fix it.
I've also just noticed that there's a problem in the first picture, too - the bit at the bottom where it currently reads 16:5965535 is supposed to say Odo: 65535.
This didn't start happening until I specified the length of the numbers that would be displayed by these sprintf commands, so I'm guessing it's something to do with that. However, it completely messes up the layout if I don't specify that the day/month/hour/minute output should be 2 digits each, or that the tachometer has five digits. Just not in the same way that this does.
Thoughts, anyone?