hi,
i am at final year student doing a project using a 8051 microcontroller control a model house .
1st part of my program is to read the sms from the modem. I do so by sending ("at+cmgr=1 \r") reading location 1 and after i read it , i send ("AT+CMGD=1 \r") to delete location. my program will keep on doing this to check the sms
2nd part of my program is to detect any gas leak in the model house. if there is a gas leak , the modem will then send a sms to the modem And the alarm will ring.
they work fine when they are standalone, however when i put both into one program only the 1st part of my program work. when there is a gas leak , only the alarm will ring and i did not receive any sms.
please advise where i can start to troubleshoot? is it the way i using to read the sms is wrong ? or ?
thanks alot
thanks you :) solve it by adding a delay
A delay is a kludge - not a solution!
You need to think about how to properly synchronise your processes.
If you just insert an arbitrary delay, then you will be wasting time in most cases, and you still have the risk that some cases may still take longer than your chosen delay!