Программа arduino выдаёт ошибку expected //primary-expression before ')' token error: //expected ';' before '}' token E

#include "pulse-sensor-arduino.h"
#include "Arduino.h"
#define PulseSensorbegin

int pulsePin = 0;                
int blinkPin = 13;                
int fadePin = 5;                 
int fadeRate = 0;                 
volatile int BPM;                  
volatile int Signal;                
volatile int IBI = 600;            

volatile boolean QS = false;        

void setup(){

  pinMode(blinkPin,OUTPUT);   
  pinMode(fadePin,OUTPUT);          
  Serial.begin(115200);           

  PulseSensorbegin();

}


void loop() {

   sendDataToProcessing('S', Signal);     
   if (QS == true) 
   {        
       fadeRate = 255;                  
       sendDataToProcessing('B',BPM);   
       sendDataToProcessing('Q',IBI);  
       QS = false;                      
   }

   ledFadeToBeat();

   delay(5000);                             
}


void ledFadeToBeat(){

    fadeRate -= 15;                         
    fadeRate = constrain(fadeRate,0,255);   
    analogWrite(fadePin,fadeRate);          
  }


void sendDataToProcessing(char symbol, int data ){

    Serial.print(symbol);                
    Serial.println(data);                
  }

/// моя программа ccp

#include "pulse-sensor-arduino.h"

volatile int rate[10];                        
volatile unsigned long sampleCounter = 0;     
volatile unsigned long lastBeatTime = 0;      
volatile int P =512;                         
volatile int T = 512;                        
volatile int thresh = 512;                    
volatile int amp = 100;                       
volatile boolean firstBeat = true;           
volatile boolean secondBeat = false;          
volatile boolean Pulse = false;              
volatile int pulsePin;

volatile int PulseSensor::IBI = 600;          
volatile int PulseSensor::BPM;                
volatile int PulseSensor::Signal;             
volatile boolean PulseSensor::QS = false;     
void PulseSensor::begin(int pPin)
{
  pinMode(pulsePin, INPUT);
  pulsePin = pPin;


  TCCR1A = 0x00;
  TCCR1B = 0x0C;  
  OCR1A = 0x7C;  
  TIMSK1 = 0x02;
  sei();             
}


ISR(TIMER1_COMPA_vect)

{                        
  cli();                                      
  PulseSensor::Signal = analogRead(pulsePin);             
  sampleCounter += 2;                         
  int N = sampleCounter - lastBeatTime;       


  if(PulseSensor::Signal < thresh && N > (PulseSensor::IBI/5)*3)
{       
    if (PulseSensor::Signal < T){                        
      T = PulseSensor::Signal;                         
    }
  }

  if(PulseSensor::Signal > thresh && PulseSensor::Signal > P)
{          
    P = PulseSensor::Signal;                             
  }                                       


  if (N > 250){                                  
    if ( (PulseSensor::Signal > thresh) && (Pulse == false) && (N > (PulseSensor::IBI/5)*3) )
    {        
      Pulse = true;                              
      PulseSensor::IBI = sampleCounter - lastBeatTime;        
      lastBeatTime = sampleCounter;              

      if(secondBeat){                        
        secondBeat = false;                 
        for(int i=0; i<=9; i++){             
          rate[i] = PulseSensor::IBI;                      
        }
      }

      if(firstBeat){                         
        firstBeat = false;                   
        secondBeat = true;                   
        sei();                               
        return;                              
      }   



      word runningTotal = 0;                    

      for(int i=0; i<=8; i++){                
        rate[i] = rate[i+1];                  
        runningTotal += rate[i];             
      }

      rate[9] = PulseSensor::IBI;                          
      runningTotal += rate[9];               
      runningTotal /= 10;                      
      PulseSensor::BPM = 60000/runningTotal;              
      PulseSensor::QS = true;                              
    }                       
  }

  if (PulseSensor::Signal < thresh && Pulse == true){   
    Pulse = false;                        
    amp = P - T;                           
    thresh = amp/2 + T;                    
    P = thresh;                          
    T = thresh;
  }

  if (N > 2500){                           
    thresh = 512;                         
    P = 512;                              
    T = 512;                               
    lastBeatTime = sampleCounter;                
    firstBeat = true;                      
    secondBeat = false;                    
  }

  sei();                                 
} 

//мое программирование заголовка

#ifndef PULSE_SENSOR_ARDUINO_H
#define PULSE_SENSOR_ARDUINO_H

#include "Arduino.h"

class PulseSensor
{
public:
  static void begin(int pulsePin);

  static volatile int BPM;          
  static volatile int Signal;        
  static volatile int IBI;           
  static volatile boolean QS;        
};

#endif 

, 👍-1