reading rpm signal from cpu fan

Thanks I finally got it working ;D

I was missing the 10k resistor and I used the following as code:

volatile byte NbTopsFan;
int hallsensor = 2;

void rpm()
{
NbTopsFan++;
}

/***************************************/
void setup()
{
// pinMode(hallsensor, INPUT);
Serial.begin(9600);
attachInterrupt(0, rpm, RISING);
};

void loop ()
{
NbTopsFan = 0;

delay (1000);
NbTopsFan = NbTopsFan * 30;
Serial.print (" ");
Serial.print (NbTopsFan, DEC);
Serial.print (" rpm");

};

It was a mix of yours and a mix of Benoit's, at least it works, now to get my character LCD to work. On a side note I couldn't get yours to work, in the terminal I would get random numbers regardless if my fan was running or not.