-

Dependents:   STM32F407_Semafor

Files at this revision

API Documentation at this revision

Comitter:
divicic
Date:
Thu Nov 26 07:51:35 2020 +0000
Commit message:
-

Changed in this revision

TrafficFlash.cpp Show annotated file Show diff for this revision Revisions of this file
TrafficFlash.h Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r a4fa725628ef TrafficFlash.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TrafficFlash.cpp	Thu Nov 26 07:51:35 2020 +0000
@@ -0,0 +1,13 @@
+#include "TrafficFlash.h"
+#include "mbed.h"
+TrafficFlash::TrafficFlash(PinName pin) : _pin(pin)
+{
+    _pin = 0;
+}
+void TrafficFlash::flash(int n)
+{
+    for(int i=0; i<n*2; i++) {
+        _pin = !_pin;
+        wait_us(10000);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r a4fa725628ef TrafficFlash.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TrafficFlash.h	Thu Nov 26 07:51:35 2020 +0000
@@ -0,0 +1,13 @@
+#ifndef MBED_TrafficFlash_H
+#define MBED_TrafficFlash_H
+#include "mbed.h"
+
+class TrafficFlash
+{
+public:
+    TrafficFlash(PinName pin);
+    void flash(int n);
+private:
+    DigitalOut _pin;
+};
+#endif
\ No newline at end of file