user55794: XRPM_COUNTERS.h:15:5: error: expected unqualified-id before string constant

     ISR(PCINT0_vect) {

     ^

In file included from C:\Documents and Settings\SAM\Desktop\automation_1_A_NEW_AAA\automation_1_A_NEW_AAA.ino:10:0:

XRPM_COUNTERS.h:72:1: error: expected ';' after class definition

 }

 ^

sketch\XRPM_COUNTERS.h: In function 'void XRPMLoop()':

XRPM_COUNTERS.h:77:19: error: 't' was not declared in this scope

   if ((millis() - t) > 300) rpm = 0;

                   ^

XRPM_COUNTERS.h:77:29: error: 'rpm' was not declared in this scope

   if ((millis() - t) > 300) rpm = 0;

                             ^

XRPM_COUNTERS.h:79:17: error: 'ot' was not declared in this scope

   else if (t != ot) {

                 ^

XRPM_COUNTERS.h:81:5: error: 'rpm' was not declared in this scope

     rpm = 60000.0 / (float)(t - ot);

     ^

XRPM_COUNTERS.h:87:13: error: 'rpm' was not declared in this scope

   lcd.print(rpm);

             ^

XRPM_COUNTERS.h:93:14: error: 'printVu' was not declared in this scope

   printVu(rpm);

              ^

sketch\XRPM_COUNTERS.h: At global scope:

XRPM_COUNTERS.h:97:1: error: expected declaration before '}' token

 };

 ^

exit status 1
expected unqualified-id before string constant

My source code
class XRPM_COUNTERS {

  private:
#include <Wire.h>  // Comes with Arduino IDE
#define interrupt_pin2 A8 //Define Analog Pin (analog pins are 16-21) 



    volatile unsigned long t = 0;

    volatile unsigned long ot = 0;



    ISR(PCINT0_vect) {

      if (PINB & 1) {

        ot = t;

        t = millis();

      }

    }


    //actualizar o visor (aqui calibrado para um maximo de 3000 rpm, basta mudar o valor)

#define max_rpm 3000

    void printVu(int r) {

      int i = map(r, 0, max_rpm, 0, 20);

      for (int n = 0; n < 20; n++) {

        lcd.print((char)(n < i ? 255 : ' '));

      }

    }


  public:

    void XRPMSetup() {
      lcd.begin(16, 2);  // initialize the lcd for 20 chars 4 lines, turn on backlight


      lcd.print("RPM with PCINT");

      MCUCR = (1 << ISC01) | (1 << ISC00);

      PCICR |= (1 << PCIE0);

      PCMSK0 |= (1 << PCINT0);

      pinMode(interrupt_pin2, INPUT); //Make pin an input

      digitalWrite(interrupt_pin2, HIGH); //Enable pullup resistor on Analog Pin

      interrupts();

    }



    unsigned int rpm = 0;


}
void XRPMLoop() {

  //lcd.setCursor(0,3);lcd.print(millis()-t);lcd.print("     ");

  if ((millis() - t) > 300) rpm = 0;

  else if (t != ot) {

    rpm = 60000.0 / (float)(t - ot);

  }

  lcd.setCursor(0, 1);

  lcd.print(rpm);

  lcd.print(" rpms    ");

  lcd.setCursor(0, 2);

  printVu(rpm);

}

};
XRPM_COUNTERS XRPM;


user55899: You placed an #include directive inside a class definition. Don't place #include directives inside class definitions. (Unless you are including a file specifically designed for that purpose.)
#include directives for regular header files should normally reside somewhere at the top of your file, separately from any other declarations.

55794: <pre><code>XRPM_COUNTERS.h:15:5: error: expected unqualified-id before string constant

     ISR(PCINT0_vect) {

     ^

In file included from C:\Documents and Settings\SAM\Desktop\automation_1_A_NEW_AAA\automation_1_A_NEW_AAA.ino:10:0:

XRPM_COUNTERS.h:72:1: error: expected ';' after class definition

 }

 ^

sketch\XRPM_COUNTERS.h: In function 'void XRPMLoop()':

XRPM_COUNTERS.h:77:19: error: 't' was not declared in this scope

   if ((millis() - t) &gt; 300) rpm = 0;

                   ^

XRPM_COUNTERS.h:77:29: error: 'rpm' was not declared in this scope

   if ((millis() - t) &gt; 300) rpm = 0;

                             ^

XRPM_COUNTERS.h:79:17: error: 'ot' was not declared in this scope

   else if (t != ot) {

                 ^

XRPM_COUNTERS.h:81:5: error: 'rpm' was not declared in this scope

     rpm = 60000.0 / (float)(t - ot);

     ^

XRPM_COUNTERS.h:87:13: error: 'rpm' was not declared in this scope

   lcd.print(rpm);

             ^

XRPM_COUNTERS.h:93:14: error: 'printVu' was not declared in this scope

   printVu(rpm);

              ^

sketch\XRPM_COUNTERS.h: At global scope:

XRPM_COUNTERS.h:97:1: error: expected declaration before '}' token

 };

 ^

exit status 1
expected unqualified-id before string constant
</code></pre>

<p>My source code</p>

<pre><code>class XRPM_COUNTERS {

  private:
#include &lt;Wire.h&gt;  // Comes with Arduino IDE
#define interrupt_pin2 A8 //Define Analog Pin (analog pins are 16-21) 



    volatile unsigned long t = 0;

    volatile unsigned long ot = 0;



    ISR(PCINT0_vect) {

      if (PINB &amp; 1) {

        ot = t;

        t = millis();

      }

    }


    //actualizar o visor (aqui calibrado para um maximo de 3000 rpm, basta mudar o valor)

#define max_rpm 3000

    void printVu(int r) {

      int i = map(r, 0, max_rpm, 0, 20);

      for (int n = 0; n &lt; 20; n++) {

        lcd.print((char)(n &lt; i ? 255 : ' '));

      }

    }


  public:

    void XRPMSetup() {
      lcd.begin(16, 2);  // initialize the lcd for 20 chars 4 lines, turn on backlight


      lcd.print("RPM with PCINT");

      MCUCR = (1 &lt;&lt; ISC01) | (1 &lt;&lt; ISC00);

      PCICR |= (1 &lt;&lt; PCIE0);

      PCMSK0 |= (1 &lt;&lt; PCINT0);

      pinMode(interrupt_pin2, INPUT); //Make pin an input

      digitalWrite(interrupt_pin2, HIGH); //Enable pullup resistor on Analog Pin

      interrupts();

    }



    unsigned int rpm = 0;


}
void XRPMLoop() {

  //lcd.setCursor(0,3);lcd.print(millis()-t);lcd.print("     ");

  if ((millis() - t) &gt; 300) rpm = 0;

  else if (t != ot) {

    rpm = 60000.0 / (float)(t - ot);

  }

  lcd.setCursor(0, 1);

  lcd.print(rpm);

  lcd.print(" rpms    ");

  lcd.setCursor(0, 2);

  printVu(rpm);

}

};
XRPM_COUNTERS XRPM;
</code></pre>
 55899: <p>You placed an <code>#include</code> directive inside a class definition. Don't place <code>#include</code> directives inside class definitions. (Unless you are including a file specifically designed for that purpose.)</p>

<p><code>#include</code> directives for regular header files should normally reside somewhere at the top of your file, separately from any other declarations.</p>
