TVZ Mechatronics Team / SevenSegmentDisplay

SevenSegmentDisplay.h

Committer:
tbjazic
Date:
2014-12-11
Revision:
1:f7a9e4c8ece6
Parent:
0:9378fe6db796
Child:
2:1c0018e87bd5

File content as of revision 1:f7a9e4c8ece6:

/**
@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