This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

using printf for serial & LCD together

in C51, the default printf() is used for serial comm., depends on putchar.c
now, i'm trying to modify it(putchar.c) for my 8-bit LCD.

the question is, can putchar.c or printf() be used on both, serial comm. and 8-bit LCD, at same time (at the same main program)?

nb: i want to display floating point, that's why i'm trying to use printf()

Parents
  • 1) Yes, you can write code that sends the data to multiple destinations. It's just up to you to implement the back-end code that takes care of the resulting characters and distributes them where you want them.

    2) Alas, I don't think Keil have fcvt() or ecvt() which would have been alternatives to printf()/sprintf(). But it is often possible to work with fixed-point arithmetic instead of floating point with very good results.

Reply
  • 1) Yes, you can write code that sends the data to multiple destinations. It's just up to you to implement the back-end code that takes care of the resulting characters and distributes them where you want them.

    2) Alas, I don't think Keil have fcvt() or ecvt() which would have been alternatives to printf()/sprintf(). But it is often possible to work with fixed-point arithmetic instead of floating point with very good results.

Children
No data