How to record count of tilt appears in Blynk

Hi, Im really newbie to this Blynk and IoT industry. I need help to figure out a solution for my project.

About my project
Im doing a smart neck support for my final year degree project. so here im using tilt sensor to detect humans neck extension and alert them using buzzer. My progress for this project is I have managed to do all circuit connection.

Problem
My problem is now how to make Blynk to record the count of neck extension. Whenever the person extend their neck posture the count should increase. and Im dont know how to code for this.
Please help me with this. Please correct me if there is any mistake in the code.

code

#define BLYNK_TEMPLATE_ID "TMPL98FVyW-b"
#define BLYNK_DEVICE_NAME "SMART NECK SUPPORT"
#define BLYNK_AUTH_TOKEN "8Laj1DCzlu6X7De8IN4peS-s6Hy6nvwu"
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>


#define EXTENSION D2 
#define LED D8 

char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "HUAWEI nova 5T";
char pass[] = "gnasegaran";

int extension_count = 0;


void setup() 
{
  Serial.begin(9600);
  pinMode(EXTENSION, INPUT);
  pinMode(LED,OUTPUT);
   Blynk.begin(auth, ssid, pass); 
 }

void loop() 
{
  Blynk.run();  
  int EXTENSION_SENSED = digitalRead(EXTENSION);

  
  if( EXTENSION_SENSED ==HIGH)
  {
    digitalWrite(LED,HIGH);
    Serial.println("EXTENSION COUNT");
    extension_count++;
  }else{
    digitalWrite(LED,LOW); 
  }

  delay(1000);
}

First of all, you should read this

https://docs.blynk.io/en/legacy-platform/legacy-articles/keep-your-void-loop-clean

@SHARVINRAJ please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

Thanks @PeteKnight for the guidance

I’m guessing that you mean you want to have Blynk display the count of neck extensions?

Once you’ve reconfigured your program structure by using a timer to call your unnecessary code that is currently in your void loop, you need to read-up on the use of the Blynk.virtualWrite command.

Pete.