Hello. This is my first post in the programmers section. I have recently gotten into micro controllers and am having a lot of fun. I am using the MSP430 Launchpad. Its cheap and very good bang for the buck.
I have successfully interfaced a 16x2 LCD (Hitachi compatible HD4478U). I had a buddy of mine help me out with the code. However, given my limited knowlege in C ++ programing, this is what code snippet I have for printing data to the LCD (this is from an .h file):
So in the main program, I would do something like: Print ("AllaboutCircuits"); and it would display this on the screen. However, I want to display data result from a calculation. For sake of simplicity, lets assume the result I am trying to display is 345 (decimal value). So I would do something like this:
int temp=0;
int test=345;
a=test/100; /*saves 3 in a
temp=test%100 /*saves 45 in temp
b=temp/10; /*saves 4 in b
c=temp%10; /*saves 5 in c
How should I go about modifying the Print code snippet to able to send the 345 to the LCD without actually using typing in "345" using Print function.
I need to learn this so that I can eventually display a voltage from a potentiometer interfacing the micro controller using A-to-D conversion. I know its a long post, but please bear with me; I am not so good in programming but trying to better my self
Thanks for looking!!!
I have successfully interfaced a 16x2 LCD (Hitachi compatible HD4478U). I had a buddy of mine help me out with the code. However, given my limited knowlege in C ++ programing, this is what code snippet I have for printing data to the LCD (this is from an .h file):
Rich (BB code):
void Print(char *Text)
{
char *c;
c=Text;
if(!Text) return;
for( c = Text; *c != '\0'; ++c)
{
SendByte(*c, TRUE);
}
}
int temp=0;
int test=345;
a=test/100; /*saves 3 in a
temp=test%100 /*saves 45 in temp
b=temp/10; /*saves 4 in b
c=temp%10; /*saves 5 in c
How should I go about modifying the Print code snippet to able to send the 345 to the LCD without actually using typing in "345" using Print function.
I need to learn this so that I can eventually display a voltage from a potentiometer interfacing the micro controller using A-to-D conversion. I know its a long post, but please bear with me; I am not so good in programming but trying to better my self
Last edited: