Can't find out how to change my pin

in my programme the flowmeter sensor and my gsm board are on the same pin but i can find how to change it (wen i put my flowmeter pin on 6 it donsen’t work any more)

int hallsensor = 6;    //The pin location of the sensor

So i can’t find out how to change my pin…

here is my programme. I wil be thank’s full for anny help o/

// include the GSM library
#include <GSM.h>

// PIN Number for the SIM
#define PINNUMBER "1234"

// initialize the library instances
GSM gsmAccess;
GSM_SMS sms;

// Array to hold the number a SMS is retreived from
char senderNumber[20];
char remoteNum[20]="+33698513237";
char txtMsgFix[200]="Nous avons debloque l'elecrovanne a votre demande !";
char txtMsg[200]="Votre arrive d'eau a etait bloque, car un probleme a etait detecte !";
  



volatile int NbTopsFan; //measuring the rising edges of the signal
int Calc;                               
int hallsensor = 2;    //The pin location of the sensor
int sec=0; 
int SecVariable=0;
int ledPin = 13;  
int Nbloquage=0;
int c = 0;
int vanne = 4;
void rpm ()     //This is the function that the interupt calls 
{ 
  NbTopsFan++;  //This function measures the rising and falling edge of the hall effect sensors signal
 } 



void setup() 
{ 
   pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input
   Serial.begin(9600); //This is the setup function where the serial port is initialised,
 
   attachInterrupt(0, rpm, RISING); //and the interrupt is attached
   pinMode(vanne, OUTPUT);

    Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  Serial.println("SMS Messages Reception");

  // connection state
  boolean notConnected = true;

  // Start GSM connection
  while (notConnected)
  {
    if (gsmAccess.begin(PINNUMBER) == GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Non connecte");
      delay(1000);
    }
  }

  Serial.println("GSM initialise");
  Serial.println("Attentes des messages...");
} 


void loop ()    
{
   digitalWrite(vanne, HIGH);
   NbTopsFan = 0;   //prépart NbTops pour le calcule
   sei();      //Enables interrupts
   delay(100);   //+0.1sc
   cli();      //Disable interrupts
   Calc = (NbTopsFan * 60 / 7.5); //(Pulse frequency x 60) / 7.5Q, = flow rate in L/hour 
   Serial.print (Calc, DEC); //Prints the number calculated above
  Serial.print (" L/hour\r\n"); //Prints "L/hour" and returns a  new line

if (Calc > 0) //peut être remplacer “0” après des test par un chiffre + grand.           
 {
   delay(8000);
   sec=sec+1;    // + 1sc de le débit coule + le delay(1000) au début do void loop
     if (sec>160)
    {
     digitalWrite(vanne, LOW); 
     delay(12000000);
     if (Nbloquage=1)
     {
       sms.beginSMS(remoteNum);
       sms.print(txtMsg);
       sms.endSMS();
       Serial.println("\nMessage Probleme envoye\n");
       // gsm envoie un sms
       // si reçois relancer le débit via gsm "Nbloquage=-1;"
     }
     
        sec=0;
     Nbloquage=Nbloquage+1;
   }  
 }
 else
 {
  delay(8000);
  sec=sec-1;
  c=c+1;
  if (sec=0) c=0;
  if (c>40)
  {
    sec=0;
    SecVariable=0;
  }
  SecVariable=SecVariable+1;
  if (Nbloquage+1>200)
  {
    //electrovanne (12v) bloquer 
     if (Nbloquage=1)
     {
        // gsm envoie un sms
        // si reçois relancer le débit via gsm "y=-1;"
     }
  }
 }
}

Looking at your code, hallsensor has to be on an interrupt pin (say either 2 or 3 on an arduino uno). If pin 3 is available, set hallsensor to 3 and change the line

attachInterrupt(0, rpm, RISING); //and the interrupt is attached

to

attachInterrupt(1, rpm, RISING); //and the interrupt is attached

6v6gt: attachInterrupt(1, rpm, RISING); //and the interrupt is attached

Would do better to let the software work out which interrupt to use i.e.

attachInterrupt(digitalPinToInterrupt(hallsensor), rpm, RISING); //and the interrupt is attached

stowite:
Would do better to let the software work out which interrupt to use i.e.

attachInterrupt(digitalPinToInterrupt(hallsensor), rpm, RISING); //and the interrupt is attached

That would be even better. And while he is at it, he should also change his PIN code from 1234 now that we all know it !