write number to a variable and display it

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
Adan_T
LCD!
Posts: 15
Joined: Sun Mar 26, 2006 12:35 pm

write number to a variable and display it

Post by Adan_T »

Hi,
I want to write a number (i.e. 127) to a variable and then display that number in
the variable on an LK204-25 LCD. I tried writing the number to the variable
with a scanf function and then displaying it but it does not seem to work. Is there
a way to write a number to a variable without using the scanf function?

Nick
Matrix Orbital
Matrix Orbital
Posts: 198
Joined: Thu Oct 27, 2005 7:46 am
Location: Calgary, Alberta
Contact:

Post by Nick »

Hi Adan,

This is getting a wee bit outside of the scope of our product. Our product displays information. How that information is gathered, parsed and presented is strictly a customer issue. Unfortunatey we do not provide design service for these types of issues.

From this question it appears that you may be missing some basic information about C. scanf is for reading from the keyboard (or other input device). The function your looking for is sprintf. This will generate a string with the variable formatted to your preferences. There are plenty of resources on the net for this very topic. If you has any further questions I suggest doing a Google search. Unfortunately we cannot teach our customers C. :)

I apologize for the inconvenience.

If you have any other questions please feel free to post them, as there are a few users on the forum that may be able to further educate you on using C to preform these actions.

Regards,
Nick Hesson
Sales Rep.
Matrix Orbital

Post Reply