ok blink
Revision 1:f91a78f50aa5, committed 2010-11-03
- Comitter:
- nielsen8
- Date:
- Wed Nov 03 00:43:51 2010 +0000
- Parent:
- 0:994d48d4baab
- Commit message:
- added on and off
Changed in this revision
blink.cpp | Show annotated file Show diff for this revision Revisions of this file |
blink.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 994d48d4baab -r f91a78f50aa5 blink.cpp --- a/blink.cpp Tue Nov 02 23:53:19 2010 +0000 +++ b/blink.cpp Wed Nov 03 00:43:51 2010 +0000 @@ -10,4 +10,15 @@ _pin = !_pin; wait(0.2); } + } + +void BLINK::on(void) +{ + _pin = 1; +} +void BLINK::off(void) +{ + _pin = 0; +} +
diff -r 994d48d4baab -r f91a78f50aa5 blink.h --- a/blink.h Tue Nov 02 23:53:19 2010 +0000 +++ b/blink.h Wed Nov 03 00:43:51 2010 +0000 @@ -11,14 +11,19 @@ class BLINK { public: /** constuctor blink - \param pin the bin we wish to blink + \param pin the pin we wish to blink */ BLINK(PinName pin); /** our flasher code \param n the number of time to flash */ void flash(int n); - + /** turn off + */ + void off(void); + /** turn on + */ + void on(void); private: DigitalOut _pin; };