user7156: #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);                
  }

/// my  ccp program 
#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();                                 
} 

//my header programing
#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 


user337: At the top of your program you have this:
#define PulseSensorbegin

which defines PulseSensorbegin as nothing
Then later you have:
PulseSensorbegin();

which the pre-processor turns into:
();

which is where the error is occurring.

7156: <pre><code>#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);                
  }
</code></pre>

<p>/// my  ccp program </p>

<pre><code>#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 &lt; thresh &amp;&amp; N &gt; (PulseSensor::IBI/5)*3)
{       
    if (PulseSensor::Signal &lt; T){                        
      T = PulseSensor::Signal;                         
    }
  }

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


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

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

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



      word runningTotal = 0;                    

      for(int i=0; i&lt;=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 &lt; thresh &amp;&amp; Pulse == true){   
    Pulse = false;                        
    amp = P - T;                           
    thresh = amp/2 + T;                    
    P = thresh;                          
    T = thresh;
  }

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

  sei();                                 
} 
</code></pre>

<p>//my header programing</p>

<pre><code>#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 
</code></pre>
 337: <p>At the top of your program you have this:</p>

<pre><code>#define PulseSensorbegin
</code></pre>

<p>which defines <code>PulseSensorbegin</code> as nothing</p>

<p>Then later you have:</p>

<pre><code>PulseSensorbegin();
</code></pre>

<p>which the pre-processor turns into:</p>

<pre><code>();
</code></pre>

<p>which is where the error is occurring.</p>
