i am doing my project on LPC2148. when i interfaced the ADC AD0.1, there is no error while compiling. When the code is debugged the result is displaying in the global register and interrupt pin ADINT is showing "1" and the result appeared is zero. Please suggest any solution to this.
Another problem is that Lcd functions which refer to lcd.h included file are showing an error called " function declared implicitly" .
May I recommend that you get a good book on the C programming language?
Not too many wants to read your code, since you didn't bother to check the posting instructions for source code - directly above the text input box.
Anyway:
if((vals > 100)&(vals<500)) { ... }
Are you really sure you should use & for your "and" expression? A good book on the C language could explain to you the difference between & and &&.
if (500<vals<800) { ... }
I don't think you picked up that expression in any good book on the C language. It does not mean what you think it does. Look closer in a book book on the C language about the precedence of operators and then try to figure out exactly what happens when that expression is seen. It is valid C code, but so very different from what you think...
So your program stalls? Wouldn't you say that a debugger would be a good too to use, to figure out where it stalls? Like in kind of looking inside the processor while the program is running? That is basically what a debugger is intended to do. Some debuggers are even quite good at it. How good is your debugger? Have you tested it yet? Programming isn't just about writing source code and getting it through the compiler. Specifications, debugging, formal testing, documentation, ... are also part of programmming.