Dependents:
STM32F407_Semafor
Revision 0:a4fa725628ef, committed 2020-11-26
- Comitter:
- divicic
- Date:
- Thu Nov 26 07:51:35 2020 +0000
- Commit message:
- -
Changed in this revision
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