LedOut

Dependents:   Telliskivi2_2014

Files at this revision

API Documentation at this revision

Comitter:
Reiko
Date:
Mon Sep 09 17:13:09 2013 +0000
Commit message:
Initial version

Changed in this revision

ledout.cpp Show annotated file Show diff for this revision Revisions of this file
ledout.h Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r e84e28f3573f ledout.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ledout.cpp	Mon Sep 09 17:13:09 2013 +0000
@@ -0,0 +1,22 @@
+#include "ledout.h"
+ 
+LedOut::LedOut(PCA9555 *ioExt, unsigned int pin)
+    : extIO(ioExt), ledPin(pin) {
+    
+}
+
+void LedOut::set() {
+    extIO->setPin(ledPin);
+}
+
+void LedOut::clear() {
+    extIO->clearPin(ledPin);
+}
+
+void LedOut::toggle() {
+    extIO->togglePin(ledPin);
+}
+
+bool LedOut::get() {
+    return extIO->getPin(ledPin);
+}
\ No newline at end of file
diff -r 000000000000 -r e84e28f3573f ledout.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ledout.h	Mon Sep 09 17:13:09 2013 +0000
@@ -0,0 +1,22 @@
+#ifndef LEDOUT_H
+#define LEDOUT_H
+
+#include "mbed.h"
+#include "PCA9555.h"
+#include "qed.h"
+ 
+class LedOut {
+public:
+    LedOut(PCA9555 *ioExt, unsigned int pin);
+ 
+    void set();
+    void clear();
+    void toggle();
+    bool get();
+ 
+private:
+    PCA9555 *extIO;
+    unsigned int ledPin;
+};
+
+#endif
\ No newline at end of file