56

Files at this revision

API Documentation at this revision

Comitter:
Paaranoja
Date:
Thu Dec 15 13:26:59 2016 +0000
Commit message:
3

Changed in this revision

Blinker.cpp Show annotated file Show diff for this revision Revisions of this file
Blinker.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Blinker.cpp	Thu Dec 15 13:26:59 2016 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+#include "Blinker.h"
+
+Blinker::Blinker(PinName pin):led(pin){
+    led = 0;
+    }
+    
+    void Blinker::blink(int n, float p){
+        for (int i = 0; i < n; i++){
+            led = 1;
+            wait(p/2);
+            led = 0;
+            wait(p/2);
+            }
+        }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Blinker.h	Thu Dec 15 13:26:59 2016 +0000
@@ -0,0 +1,9 @@
+#include "mbed.h"
+
+class Blinker {
+    public:
+    Blinker(PinName pin);
+    void blink(int, float);
+    private:
+    DigitalOut led;
+    };
\ No newline at end of file