Simple Debug LED or indicator class, runs in background for minimal code disruption. 5 Modes with some special functions
Dependents: Flasher_HelloWorld
Revision 1:e94a73b015cc, committed 2011-02-26
- Comitter:
- p07gbar
- Date:
- Sat Feb 26 13:17:23 2011 +0000
- Parent:
- 0:5c6eb2d20a5a
- Commit message:
- V1.1
Changed in this revision
Flasher.cpp | Show annotated file Show diff for this revision Revisions of this file |
Flasher.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Flasher.cpp Sat Feb 19 14:27:21 2011 +0000 +++ b/Flasher.cpp Sat Feb 26 13:17:23 2011 +0000 @@ -137,3 +137,14 @@ return statein; } } + +Flasher& Flasher::operator= (int statein) +{ + updateFlash(statein); + return *this; +} + +Flasher::operator int() +{ + return state; +}
--- a/Flasher.h Sat Feb 19 14:27:21 2011 +0000 +++ b/Flasher.h Sat Feb 26 13:17:23 2011 +0000 @@ -60,11 +60,11 @@ * int main() { * while(1){ * wait(5); - * myFlasher.updateFlash(ON); + * myFlasher = ON; * wait(5); * myFlasher.updateFlash(SLOW); * wait(5); - * myFlasher.updateFlash(MEDIUM); + * myFlasher = MEDIUM; * wait(5); * myFlasher.updateFlash(QUICK); * wait(5); @@ -147,7 +147,19 @@ float getFlashTime(int statein); +/** Sets state quickly + * + * @param statein State to change to + */ +Flasher& operator= (int statein); + +/** Gets State quickly + * + * @param returns Current state + */ + +operator int(); private: