Example of bearbones class
Revision 0:809707a63c26, committed 2017-09-26
- Comitter:
- zer044
- Date:
- Tue Sep 26 08:43:25 2017 +0000
- Commit message:
- Initial Commit
Changed in this revision
AClassy.cpp | Show annotated file Show diff for this revision Revisions of this file |
AClassy.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 809707a63c26 AClassy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AClassy.cpp Tue Sep 26 08:43:25 2017 +0000 @@ -0,0 +1,16 @@ +#include "AClassy.h" + +ClassyClass::ClassyClass() +{ +//Constructor does nothing atm +} + +ClassyClass::~ClassyClass() +{ +//Destructor does nothing atm +} + +void ClassyClass::setLEDstate(int state) +{ + ledy2.write(state); +} \ No newline at end of file
diff -r 000000000000 -r 809707a63c26 AClassy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AClassy.h Tue Sep 26 08:43:25 2017 +0000 @@ -0,0 +1,29 @@ +#include "mbed.h" + +class ClassyClass +{ + +public: +//Constructor Definition +ClassyClass(); + +//define destructors +~ClassyClass(); + +//Add Function headers here +void setLEDstate(int state); + + + + + +private: +//Add all private variables/Objects here only ClassyClass can see these + +//Essentially global to this Class +int imprivate; + +DigitalOut ledy2_(p9); + +}; +