Het maken van een Bibliotheek

Beste Forumleden,

ik heb een best groot stukje tekst wat ik alleen maar gebruik om mijn volume naar beneden te krijgen.
nu dacht ik, ik maak er een libary van. geen gekke gedachte alleen krijg steeds een foutmelding;

"Arduino: 1.8.5 (Windows 10), Board:"Arduino/Genuino Uno"

VolumeDown.h:13: error: expected unqualified-id before ')' token

     void VolumeDown();

                     ^

VolumeDown.h:17: error: abstract declarator '<anonymous class>' used as declaration

 };

 ^

exit status 1
expected unqualified-id before ')' token

dit is mijn VolumeDown.h File:

#ifndef VolumeDown
#define VolumeDown

#if (ARDUINO >=100)
  #include "Arduino.h"
#else
  #include "WProgram.h"
#endif

class VolumeDown 
{
    public:
    void VolumeDown();
    private:
    
   
};
#endif

en dit is mijn VolumeDown.cpp;

#include "Arduino.h"
#include "VolumeDown.h"
void VolumeDown::VolumeDown(){
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x1F);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x1E);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x1D);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x1C);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x1B);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x1A);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x19);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x18);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x17);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x16);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x15);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x14);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x13);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x12);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x11);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x10);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0xF);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0xE);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0xD);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0xC);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0xB);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0xA);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x9);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x8);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x7);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x6);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x5);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x4);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x3);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x2);
Serial.write(0x7E);
delay(300);
Serial.write(0x7E);
Serial.write(0x03);
Serial.write(0xA7);
Serial.write(0x1);
Serial.write(0x7E);
delay(300);
}

ik heb er al een nachtje over geslapen maar kom er nog steeds niet uit. kan een van jullie mij helpen met deze opgave

bedankt voor het meekijken.

mvg Jeroen

VolumeDown is de class name. De method VolumeDown wordt dan gezien als de constructor. En die heeft geen return code. Dus zonder de void. Void dus weg laten

Overigens is voor het vaak hetzelfde doen de loop uitgevonden :wink: Ook is het vaak niet zo practisch seconden lang te wachten in delays...