Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:79b634f90b8c, committed 2022-11-27
- Comitter:
- tinek
- Date:
- Sun Nov 27 12:24:33 2022 +0000
- Commit message:
- Final
Changed in this revision
Signal.cpp | Show annotated file Show diff for this revision Revisions of this file |
Signal.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Signal.cpp Sun Nov 27 12:24:33 2022 +0000 @@ -0,0 +1,20 @@ +#include "Signal.h" +#include "mbed.h" + +Signal::Signal(PinName pin) : _pin(pin) +{ + _pin = 0; +} + +void Signal::light(int n) +{ + if (n == 0) { + _pin = n; + } else if (n == 1) { + _pin = n; + } else if (n == 2) { + _pin = (n - 1); + wait(0.5); + _pin = (n - 2); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Signal.h Sun Nov 27 12:24:33 2022 +0000 @@ -0,0 +1,16 @@ +#ifndef MBED_SIGNAL_H +#define MBED_SIGNAL_H + +#include "mbed.h" + +class Signal +{ +public: + Signal(PinName pin); + void light(int n); + +private: + DigitalOut _pin; +}; + +#endif