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.
Diff: Signal.cpp
- Revision:
- 0:79b634f90b8c
diff -r 000000000000 -r 79b634f90b8c Signal.cpp
--- /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