03*****@rgu.ac.uk wrote:
>
I am doing my honours project at uni and have to use C programming and
the IIC bus, not the best combination as I have never done that much
programming and I had never heard of the IIC bus! Anyway, I am getting
on quite well now but I have come up with a problem! I am reading GPS
data from the IIC bus as a signed short, I need to convert this 16-bit
value to ASCII code for use with my LCD display, also controlled on
the IIC bus! Any suggestion anyone? Cheers!
The IIC bus, the LCD display, etc. are off-topic here. They are
topical on comp.arch.embedded.
Conversion of 16 bit integers to strings is dead easy. For example:
void writeint(unsigned int i, FILE *dest) {
if (i 0) writeint(i / 10, dest);
putc((i % 10) + '0', dest);
}
but embedded machines may have restrictions on recursion, etc,
which is why c.a.e is appropriate.
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
--
Posted via a free Usenet account from
http://www.teranews.com