Arduino Programming in 24 Hours, Sams Teach Yourself by Blum Richard

Arduino Programming in 24 Hours, Sams Teach Yourself by Blum Richard

Author:Blum, Richard [Blum, Richard]
Language: eng
Format: azw3, epub
Publisher: Pearson Education
Published: 2014-08-07T16:00:00+00:00


* * *

Try It Yourself: Creating the Library Code File

Let’s create a library of simple math functions that we can import into our sketches. Follow these steps:

1. Open a standard text editor on your system (such as Notepad in Windows or TextEdit on OS X).

2. Enter this code into the text editor window:

Click here to view code image

#ifndef MyLib_h

#define MyLib_h

#include "Arduino.h"

class MyLibClass {

public:

int addem(int, int);

int subem(int, int);

int multem(int, int);

};

extern MyLibClass MyLib;

#endif

3. Save the file to your desktop (or some other common folder) as MyLib.h.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.