Hi gabriellimhj,
What is the GSM modem or related hardware that you're using?
May I ask what does your code does?
From what I understand (correct me if I'm wrong):
- You're setting the preferred message format to text based (AT+CMGF=1)
- I'm not sure what is the ALL section of the AT+CMGL="ALL" does but I presume based on the AT_CMGL means that you are trying to list all the message (AT+CMGL="ALL").
- From what I can see from the case structure and while loop in it, if there is a message in the list, then you're to delete the first index of the message (AT+CMGD=1) when the byte exceeds 21 and it will continue to delete index 1 until you stop it?
When you mentioned that the second SMS is not shown, was the 1st SMS shown? Is all the message content been deleted or that the message received is still there?
If you want the use to press the button to delete the message, why did you place that delete command within the while loop instead of the below screenshot?:
Warmest regards,
Lennard.C