Why won't my hall counter count?
const int Hallsensor=3;
int HallValue;
int LastHallValue;
int Hcount =0;

unsigned long timer = 0;
unsigned long lastChangeTime = 0;

void setup()
{

  pinMode(Hallsensor, INPUT);
  Serial.begin(9600);
   counting = true;
    start_time = millis();


}

void loop()
{

    LastHallValue = HallValue;
    HallValue = digitalRead(Hallsensor); 
    if (HallValue == LOW and LastHallValue == HIGH){
        Hcount++;
        lastChangeTime = millis();
        Serial.println(Hcount);   
    }
    else{
        if(counting == true){
            Serial.print("Count is");
            Serial.println(Hcount);
            counting = false;
            // Serial.println(LastHallValue);    
        }
    }

    if( (Hcount&gt;0) &amp;&amp; (millis() - lastChangeTime) &gt;= 1000){
        Hcount = 0;// reset count when it hasn't increased in the last second.
    }

}