when i use the coding " mmb_lcdPutCtl(LCD_CGRAM(1));" in my program...it shows an error that "requires ANSI-STYLE prototype"
wat doesn that mean? how do i solve this? thanks
It still means exactly what it says - this hasn't changed since you posted exactly the same question the other day: www.8052.com/.../read.phtml
This is standard ASNI 'C' - nothing specifically to do with Keil or the 8051!
ya...textbook is not clear...
Have you defined prototypes for mmb_lcdPutCtl() and CD_CGRAM() and does the compiler get to parse them before it reaches the line?
no...cos i don know how to define and i got that from a site...can give me an example?
"textbook is not clear"
In that case, you need to get a better textbook!
This is absolutely fundamental to any serious programming in the 'C' language - if your textbook fails at this, I wouldn't trust it for anything else!
You said you're a final-year student: " href= "http://www.8052.com/forum/read.phtml?id=144687">www.8052.com/.../read.phtml
A function is declared either by providing a Prototype, or an actual definition:
A Prototype gives: * The name of the function (its "identifier"); * The parameters (if any) required by the function; * The return type of the function.
For example,
int my_function( int its_paramer ); // Note the semicolon
A function Definition includes the Body of the function - ie the code that implements it; For example,
int my_function( int its_paramer ) // Note NO semicolon { // The braces mark the body return its_parameter + 1; }
Whe a function is Defined in one source file, but needs to be called in another, it is common to provide the Prototype in a header file
See: c-faq.com/.../decldef.html
"i don know how to define and i got that from a site"
That's the trouble with just asking for "Sample Code" when you don't actually understand what's going on.
There are two pre-requisites:
1. You need a working understanding of the 'C' programming language;
2. You need a working understanding of LCDs.
You need to lay these foundations before you start building your skyscraper!
thanks for ur help...i'm taking time to read ur textbook...:) since we are scheduled very tightly for this FYP, have to rush to finish this project in time...worsely...it's individual...no experience on this C programming...never learnt before....:)
"have to rush to finish this project in time"
No, that shouldn't be the case:
If you were given it as a 12-week project, that must surely mean that they expect that a final-year student worthy of a "pass" should be capable of doing it in 12 weeks?
If you really feel that this is not the case, then you need to speak to your tutor(s) about it now!!
"no experience on this C programming"
So why did you choose a project that relies upon it, and also relies upon LCDs - of which you also have no experience?!
Again, did you check this with your tutor(s)?
no....things here is different..every students doing the same way...but the difference is that the difficulty level...like some other student juz has to do the PCB design...and it's random...mean even my supervisor doesn't know how it is generated by pc...to be more clear...there are many lab rooms in engineering lab and a group of students are posted to different lab rooms...then in each specified lab, there are few different projects for students...and the lab in charge chooses the project to each student according to their grade point...unfortunately...in my lab, my grade point is the highest ..and i got this project...i don want to give negative response to my supervisor as well...so i'm trying my best to be done in time