TVZ Mechatronics Team / SevenSegmentDisplay
Revision:
0:9378fe6db796
Child:
1:f7a9e4c8ece6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SevenSegmentDisplay.h	Thu Dec 11 08:01:43 2014 +0000
@@ -0,0 +1,39 @@
+/********************************************************************************
+@author Toni Bjazic
+
+@section LICENSE
+Creative Commons CC BY-SA
+ 
+@section DESCRIPTION
+A class for controling the output of 7-segment displays (common anode or common
+cathode).
+
+********************************************************************************/
+
+#ifndef SEVEN_SEGMENT_DISPLAY_H_KEY
+#define SEVEN_SEGMENT_DISPLAY_H_KEY
+
+#include "mbed.h"
+
+enum ConnectionMode {CommonAnode, CommonCathode};
+
+class SevenSegmentDisplay {
+public:
+    SevenSegmentDisplay(PinName a,
+                        PinName b, 
+                        PinName c, 
+                        PinName d, 
+                        PinName e, 
+                        PinName f, 
+                        PinName g, 
+                        PinName dp,
+                        ConnectionMode cm = CommonAnode);
+    void init();
+    void print(char);
+private:
+    BusInOut display;
+    ConnectionMode mode;
+    void turnOn(int);
+};
+
+#endif
\ No newline at end of file