nissan20det:
Okay well back to the "%3d" that still wont work and I dont uunderstand how you think it would? you say if their the same width, say 5 pixels at size 1, A displayed 3 would get covered and overwritten by an 8 but an 8 to a 1 won't? or say an 8 to 0 youll still have an 8?
Like I said, it depends on how they render characters. If they render/draw all the pixels of the character, then a character will be completely overwritten when a new character is drawn on top it.
The pixels of the glyph are the foreground color and the other pixels are the background color.
i.e. if the font is 5x7 pixels, all 35 pixels get drawn not just the pixels of the actual character glyph.
However, if they only draw the glyph pixels, the new character is OR'd into the existing pixels and so you get an overstrike effect.
Which way it works depends on how the code renders the font.
It is very easy to tell which way it works. Just print 2 characters at the same position.
The graphic library I wrote does both. By default it overwrites but the user can ask for overstrike instead.
nissan20det:
o an one more thing... I take my readings from the accelerometer map(Name, sensor tilted left, sensor titled right, -90, 90) to get degrees of tilt. Now if I put in -900, 900 I get a tenths value thats handy. How do I put a decimal in a number? I tried using a float instead of integer and just got a 6 digit number, also tried "%f" and I just get a ?, and lastly I tried the "%e+2" and nothing works....
The Arduino IDE uses a linker option that disables printf() floating point support.
This was done to save code space. If it is enabled you use about 2k of code whether you are using floating point support in the printf code or not.
This linker option was hard coded in IDE prior to 1.5x but now it is in the platform.txt file so you can patch it to always enable floating point support if you want.
Change this:
compiler.c.elf.flags=-Os -Wl,--gc-sections
to this:
compiler.c.elf.flags=-Os -Wl,--gc-sections -Wl,-u,vfprintf -lprintf_flt
Alternatively, you can do some simple integer and modulo math to create separate numbers for the integer quotient and a 1 digit mantissa and then print them using something like "%3d.%1d" The %3d is for the two digits and the minus sign and the %1 is for the 1 digit fractional part.
You divide the value by 10 to get the integer portion and modulo by 10 to get the 1 digit fractional portion.
i.e
whole = value / 10;
fract = value %10;
sprintf(buf, "%3d.%1d", whole, fract);
--- bill