hi all.... This is Gaurav Kothari. I want a very small help from you. As i new to programming part, i started my new project of hello world. my lcd prints it perfectly But now i want my lcd to ask the name first and then to print hello and then the name entered. can anybody please me....
So what input facilities do you have?
i have attached a keypad and lcd. lcd is being attached on port1 and keypad on port 0 and 2. i wrote a command printstring("Hello",name); but it shows me a error... too many parameters
Do you have no access to books, or online resources, about C programming?
So "too many parameters" suggests the function can print only ONE string at a time, no? You could look at the definition of the function too, if it's not clear from the documentation, or the error.
{ char string[64]; sprintf(string, "Hello %s",name); printstring(string); }
This is my code.... .. unsigned char time[3]={"00"}; void main() { unsigned int i,k;
lcdcmd(0x38); lcdcmd(0x0F); lcdcmd(0x06); lcdcmd(0x01); { printstring("ENTER TIME:"); lcdcmd(); i=0; do { time[i]=keypad(); lcddata(time[i]); i++; } while(i!=2); i=0; lcdclear(); printstring("TIME SET", time); msdelay(200); } }
This is my code.... ..
unsigned char time[3]={"00"}; void main() { unsigned int i,k; lcdcmd(0x38); lcdcmd(0x0F); lcdcmd(0x06); lcdcmd(0x01); { printstring("ENTER TIME:"); lcdcmd(); i=0; do { time[i]=keypad(); lcddata(time[i]); i++; } while(i!=2); i=0; lcdclear(); printstring("TIME SET", time); msdelay(200); } }
"but it (sic) shows me a error..."
What do you mean by "it" ?
I guess you mean that this is a Compiler message when you build your code?
"too many parameters"
So use fewer parameters, then!
yes it give me error when i try to build... fewer parameters.... how can i.... do i need to change the code
"it give me error"
You still haven't said what "it" is !!
Nor when or where this happens!
"fewer parameters.... how can i"
Do you understand what "parameters" are in a 'C' function call?
"fewer" means "not so many"; eg, one parameter is fewer than two parameters.
"do i need to change the code"
Clearly, yes!!
This is my code....
It rather obviously is not your code, but rather somebody else's code that you, well, let's call it "picked up", somewhere, but you don't understand it at all.
So guess what: if you want to learn programming, you'll actually have to do just that: learn. And no, just copy-pasting random stuff you don't understand is not the same thing.
And no, just copy-pasting random stuff you don't understand is not the same thing.
Very true. But it doesn't seem to have harmed the income of some consultants I've had the (mis-)fortune to deal with over the years.
View all questions in Keil forum