How to get two function to run together

i have a gsm module to send a call after a certain range of temperature which i working fine then i have an led to blink after a predefined time also working but i run into a problem when i combine both code together… after joining the codes only the part of the call works .

here’s the code…

#include <SoftwareSerial.h>
#include <dht.h>
dht DHT;
SoftwareSerial mySerial(7, 8);

#define DHT11_PIN 2

int sensor=2;
float temp_read,Temp_alert_val,Temp_shut_val,hum_read;
int call_count=0;
unsigned long startTime;

void setup()
startTime = millis();
pinMode(13, OUTPUT);

void loop()

void CheckHum()
if(Temp_alert_val< 25.00)
SetAlert(); // Function to send Call Alerts

float CheckTemp()
int chk = DHT.read11(DHT11_PIN);
temp_read = DHT.temperature;
hum_read = DHT.humidity;
return temp_read;
return hum_read;


void SetAlert()
while(call_count<3) //Number of Calls Alerts to be sent
MakeCall(); // Function to send AT Commands to GSM module

void MakeCall()
mySerial.println(“ATD;”); // ATDxxxxxxxxxx; – watch out here for semicolon at the end!!
Serial.println("Calling ; "); // print response over serial port
Serial.println(“Hangup Call”);


void BeatSignal(){
unsigned long inputTime = 0;

inputTime = 10000;
Serial.print(“am here”);

if(millis() - startTime == inputTime){

startTime = millis(); //reset the timer

Plz any idea is appreciated thank you

Please put your code inside code blocks as the test parser in the regular window likes to change character sequences into emoticons.

You have a smiley with sun glasses in your code... :o

SoftwareSerial mySerial(7, 8);

One you'll have read the rules on posting questions and code here, you can turn your attention the the other posts pinned at the top of the forum, including "Using millis() for timing. A beginners guide" -->> that will give you an idea on how to manage multiple things at once

i tried that using millis(); but it works alone but when i join with the other code it doesnt work… any other suggestions u can give??

any other suggestions u can give??

Post the code, using code tags, and describe what happens when you run it.

Have you read Using millis() for timing. A beginners guide, Several things at the same time and look at the BlinkWithoutDelay example in the IDE.

i finally got it to work using the millis(); function

unsigned long currentMillis = millis();

if (currentMillis - previousMillis >= interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;

// if the LED is off turn it on and vice-versa:
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;

my mistake was
if (currentMillis - previousMillis == interval)...
so changed it to >=

i finally got it to work using the millis(); function

That's good.