Im trying to write my own library to work a seven segment display and have gotten the .h file and .cpp files to not put out errors but I cant work out how to call any of the functions in the library.
attached is the .h file .cpp file and the sketch to use the library.
the error I keep getting is
C:\Users\Matt\Desktop\sevenSegLib\sevenSegLib.ino: In function 'void loop()':
sevenSegLib:14:11: error: request for member 'one' in 'sevenSeg', which is of non-class type 'sevenSeg()'
sevenSeg.one();
^
Using library sevenSeg in folder: F:\Program Files (x86)\Arduino\libraries\sevenSeg (legacy)
exit status 1
request for member 'one' in 'sevenSeg', which is of non-class type 'sevenSeg()'
EDIT:
I just realized im not assigning a pin anywhere but if I put 2 in the parentheses in like this sevenSeg sevenSeg(2);
I get this error
sevenSegLib:3:20: error: no matching function for call to 'sevenSeg::sevenSeg(int)'
sevenSeg sevenSeg(2);
^
In file included from C:\Users\Matt\Desktop\sevenSegLib\sevenSegLib.ino:1:0:
F:\Program Files (x86)\Arduino\libraries\sevenSeg/sevenSeg.h:6:7: note: candidate: sevenSeg::sevenSeg()
class sevenSeg
^
F:\Program Files (x86)\Arduino\libraries\sevenSeg/sevenSeg.h:6:7: note: candidate expects 0 arguments, 1 provided
F:\Program Files (x86)\Arduino\libraries\sevenSeg/sevenSeg.h:6:7: note: candidate: constexpr sevenSeg::sevenSeg(const sevenSeg&)
F:\Program Files (x86)\Arduino\libraries\sevenSeg/sevenSeg.h:6:7: note: no known conversion for argument 1 from 'int' to 'const sevenSeg&'
F:\Program Files (x86)\Arduino\libraries\sevenSeg/sevenSeg.h:6:7: note: candidate: constexpr sevenSeg::sevenSeg(sevenSeg&&)
F:\Program Files (x86)\Arduino\libraries\sevenSeg/sevenSeg.h:6:7: note: no known conversion for argument 1 from 'int' to 'sevenSeg&&'
Using library sevenSeg in folder: F:\Program Files (x86)\Arduino\libraries\sevenSeg (legacy)
exit status 1
no matching function for call to 'sevenSeg::sevenSeg(int)'
EDIT #2:
Sorry for spaghetti code
sevenSegLib.ino (205 Bytes)
sevenSeg.h (637 Bytes)
sevenSeg.cpp (3.37 KB)