We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
i am interested in writing a program in keil for humidity measurement can any body provide the code in C please it is uRgent
Since you didn't state which '51 derivative you are going to use, how exactly you are going to measure humitidy, and what you actually want to do with the data, one can only try to guess these details.
I'll assume you will measure the humidity with a sensor that can send an interrupt signt, and want to transmit the humidity data to some upstream instance (for example, a PC)
A very basic framework would look like this:
extern void initialize(); extern void process_measurement(); extern void transmit_data(); extern bit new_data_available; int main(void) { initialize(); for(;;) { while(!new_data_available); process_measurement(); transmit_data(); } }
Of course, it is lacking almost every detail. You will need to figure out what exactly needs to be done in initialize(), write an ISR that sets new_data_available every time a new value arrives, do some sort of post-processing of the data in process_measurement() and flesh out transmit_data() to send the new value to your chose upstream instance using your chosen type of interface.
The interesting thing with thae above code, is that a lot of noobs will manage to enter it as:
for (;;) { while (!new_data_available) process_measurement(); transmit_data(); }
and then spend the next two weeks trying to understand what goes wrong :)
"Of course, it is lacking almost every detail"
Suits the question admirably, then! ;-)