pikachu!!pikapikka!!

Files at this revision

API Documentation at this revision

Comitter:
sgrsn
Date:
Thu Jun 18 08:05:03 2015 +0000
Commit message:
pikachu!!pikapikka!!!pi-ka-chu---------!!!!!!

Changed in this revision

pikachu.cpp Show annotated file Show diff for this revision Revisions of this file
pikachu.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pikachu.cpp	Thu Jun 18 08:05:03 2015 +0000
@@ -0,0 +1,14 @@
+#include "pikachu.h"
+#include "mbed.h"
+
+    pikachu::pikachu(PinName p) : _pin(p) {
+        _pin = 0;
+    }
+    
+     void pikachu::flash(int n) {
+        for(int i=0; i<n*2; i++) {
+            _pin = !_pin;
+            wait(0.1);
+        }
+    }
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pikachu.h	Thu Jun 18 08:05:03 2015 +0000
@@ -0,0 +1,16 @@
+#ifndef MBED_pikachu_H
+#define MBED_pikachu_H
+
+#include "mbed.h"
+
+class pikachu {
+private:
+    DigitalOut _pin;
+public:
+    pikachu(PinName p);
+    
+    void flash(int n);
+};
+
+#endif
+