GSM Module - Dial Multiple

I want to dial 2 mobile numbers from SIM800L module when the the arduino gets a trigger signal. Here how I do one after the other. I'm not sure how the delay affects.....How to do it professionally?

	mySerial.println("ATD +ZZxxxxxxxxx;");Dial Phone Number 1
  	delay(1000);
	delay(1000);	
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	mySerial.println("ATH;");
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	//
	mySerial.println("ATD +ZZxxxxxxxxx;");Dial Phone Number 2
  	delay(1000);
	delay(1000);	
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	mySerial.println("ATH;");
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	//
  	delay(1000);
	delay(1000);	
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);
	delay(1000);

Why ?

Its for safe. Sometimes it takes time to take a call. Without making at least 10 seconds the 2nd call never goes.

Then why not

delay(10000);

I did that way while experimenting (To check how many delays I need) . I can write that in one line as you say.Apart from these can you see any other improvements?

But why not use a single delay() whilst experimenting?

Is the Arduino required to do anything else between dialling the 2 numbers or are you happy that the Arduino is locked up during the delay() ?

1 Like

Arduino does not have to do anything between dial1 & 2.

Presumably it does something after dialling the number

AFter dialing ~10Sec I send a call Hang Command. It is clearly shown in code.

I was expecting the code to do actually do something rather than dialling and hanging up

I was expecting a professional reply regarding the procedure of dialing 2 numbers in a professional manner. No need to post entire code which has the initialize & trigger inputs. The trigger signal can be a micro switch etc...

My main concern is some times it misses the 2nd call.

Except, of course, we can't see which library you are using to implement the mySerial object, it's baud rate or which pins it is using, any or all of which may influence the running of the program