Anders53:
AFAIK you also need a keyword txt file.
Have a look in your existing library and get a peep on how the files are arranged.
I've tried your code submitted above, and it does compile all sailing flags no errors.
The keywords file is completely optional. I've never included one with any library I've written.
It looks like you are at the point where you are ready to put this into .h and .cpp files. The class definition goes in the .h file. All the function definitions go just like they are into the .cpp file. The sketch part, the two objects you create and setup and loop, all stay in the .ino file.
You mention errors. How can I help fix errors if you won't tell me what they are?
i have created the .h and .cpp file.the files are attached below.when i use library i get errors
D:\Arduino\libraries\Lp\Lp3943.cpp:1: error: stray ‘\357’ in program
D:\Arduino\libraries\Lp\Lp3943.cpp:1: error: stray ‘\273’ in program
D:\Arduino\libraries\Lp\Lp3943.cpp:1: error: stray ‘\277’ in program
D:\Arduino\libraries\Lp\Lp3943.cpp:1: error: stray ‘#’ in program
D:\Arduino\libraries\Lp\Lp3943.cpp:1: error: expected constructor, destructor, or type conversion before string constant
D:\Arduino\libraries\Lp\Lp3943.cpp:3: error: ‘Lp3943’ has not been declared
D:\Arduino\libraries\Lp\Lp3943.cpp:3: error: ISO C++ forbids declaration of ‘Lp3943’ with no type
D:\Arduino\libraries\Lp\Lp3943.cpp: In function ‘int Lp3943(char)’:
D:\Arduino\libraries\Lp\Lp3943.cpp:6: error: ‘address’ was not declared in this scope
D:\Arduino\libraries\Lp\Lp3943.cpp: At global scope:
D:\Arduino\libraries\Lp\Lp3943.cpp:8: error: ‘Lp3943’ is not a class or namespace
D:\Arduino\libraries\Lp\Lp3943.cpp:8: error: ISO C++ forbids declaration of ‘Lp3943’ with no type
D:\Arduino\libraries\Lp\Lp3943.cpp: In function ‘int Lp3943(char, char, char, char, char)’:
D:\Arduino\libraries\Lp\Lp3943.cpp:11: error: ‘address’ was not declared in this scope
D:\Arduino\libraries\Lp\Lp3943.cpp:12: error: ‘setting’ was not declared in this scope
D:\Arduino\libraries\Lp\Lp3943.cpp: At global scope:
D:\Arduino\libraries\Lp\Lp3943.cpp:18: error: ‘Lp3943’ is not a class or namespace
D:\Arduino\libraries\Lp\Lp3943.cpp: In function ‘void setprescaler(int, char)’:
D:\Arduino\libraries\Lp\Lp3943.cpp:21: error: ‘setting’ was not declared in this scope
D:\Arduino\libraries\Lp\Lp3943.cpp:23: error: ‘setting’ was not declared in this scope
D:\Arduino\libraries\Lp\Lp3943.cpp: At global scope:
D:\Arduino\libraries\Lp\Lp3943.cpp:26: error: ‘Lp3943’ is not a class or namespace
D:\Arduino\libraries\Lp\Lp3943.cpp: In function ‘void setpwm(int, char)’:
D:\Arduino\libraries\Lp\Lp3943.cpp:29: error: ‘setting’ was not declared in this scope
D:\Arduino\libraries\Lp\Lp3943.cpp:31: error: ‘setting’ was not declared in this scope
D:\Arduino\libraries\Lp\Lp3943.cpp: At global scope:
D:\Arduino\libraries\Lp\Lp3943.cpp:34: error: ‘Lp3943’ is not a class or namespace
D:\Arduino\libraries\Lp\Lp3943.cpp: In function ‘void ledstate(int, int)’:
D:\Arduino\libraries\Lp\Lp3943.cpp:41: error: ‘array’ was not declared in this scope
Other things can give the "stray" error message. Sometimes when you cut-and-paste from a printed article into the IDE, you will see this error near a string literal. The reason is because the article used "right-leaning" and "left-leaning" double quote marks, which the IDE doesn't deal with very gracefully. Simply re-type the double quote marks and some of those errors will disappear.