 
 void setup()
 {
-    //Setup pins
-    pinMode (start,INPUT);
-    pinMode(vibra, INPUT);
-    pinMode(interrupter, INPUT);
-    pinMode(fuel, OUTPUT);
-    
+    setPins();    
     delay(500);
-
-    setInputPins();    
     setFuel(true);
     calibrateAccel();
     startModule();

#define ALARM_BUZZ 2

/*================================ Analog pins =========================================*/
const int buzzerPin = A2; // buzzer Pin connected to Analog 1
const int x = A3; // X pin connected to Analog 3
const int y = A4; // Y pin connected to Analog 4
const int z = A5; // Z pin connected to Analog 5

/*================================ Digital pins ========================================*/
const int start = 10;         // Alarm button enabletion connected to Digital 10
const int interrupter = 9;   // Doors interrupters pin
const int vibra = 8;         // checkVibrate sensor pin
const int fuel = 6;          //fuel Control

/*============================= controll variables =====================================*/
int tolerance = 40;          // Sensitivity of the Alarm
boolean calibrate = false;   // When accelerometer is calibrated - changes to true
boolean shouldAlarm = false; // When motion is detected - changes to true
int curState = ALARM_OFF;    // Alarm machine state

/*============================ Accelerometer limits ====================================*/
int xMin; //Minimum x Value


void sendGps()
{
    if(sendGpsData) {
      tone(buzzerPin, 100);
      mqttClient.publish(gpsTopic,simClient.getGPS());
      sendGpsData = false;
      noTone(buzzerPin);
      delay(500);  
    }
}

//Function used to detect motion. Tolerance variable adjusts the sensitivity of movement detected.
