Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SevenSegmentDisplay.h@2:1c0018e87bd5, 2014-12-11 (annotated)
- Committer:
- tbjazic
- Date:
- Thu Dec 11 08:14:39 2014 +0000
- Revision:
- 2:1c0018e87bd5
- Parent:
- 1:f7a9e4c8ece6
- Child:
- 3:9c9257dda979
documentation test 2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tbjazic | 1:f7a9e4c8ece6 | 1 | /** |
tbjazic | 2:1c0018e87bd5 | 2 | * @author Toni Bjazic |
tbjazic | 2:1c0018e87bd5 | 3 | * @section LICENSE |
tbjazic | 2:1c0018e87bd5 | 4 | * Creative Commons CC BY-SA |
tbjazic | 2:1c0018e87bd5 | 5 | * @section DESCRIPTION |
tbjazic | 2:1c0018e87bd5 | 6 | * A class for controling the output of 7-segment displays (common anode or common |
tbjazic | 2:1c0018e87bd5 | 7 | * cathode). |
tbjazic | 2:1c0018e87bd5 | 8 | */ |
tbjazic | 0:9378fe6db796 | 9 | |
tbjazic | 0:9378fe6db796 | 10 | #ifndef SEVEN_SEGMENT_DISPLAY_H_KEY |
tbjazic | 0:9378fe6db796 | 11 | #define SEVEN_SEGMENT_DISPLAY_H_KEY |
tbjazic | 0:9378fe6db796 | 12 | |
tbjazic | 0:9378fe6db796 | 13 | #include "mbed.h" |
tbjazic | 0:9378fe6db796 | 14 | |
tbjazic | 0:9378fe6db796 | 15 | enum ConnectionMode {CommonAnode, CommonCathode}; |
tbjazic | 0:9378fe6db796 | 16 | |
tbjazic | 0:9378fe6db796 | 17 | class SevenSegmentDisplay { |
tbjazic | 0:9378fe6db796 | 18 | public: |
tbjazic | 0:9378fe6db796 | 19 | SevenSegmentDisplay(PinName a, |
tbjazic | 0:9378fe6db796 | 20 | PinName b, |
tbjazic | 0:9378fe6db796 | 21 | PinName c, |
tbjazic | 0:9378fe6db796 | 22 | PinName d, |
tbjazic | 0:9378fe6db796 | 23 | PinName e, |
tbjazic | 0:9378fe6db796 | 24 | PinName f, |
tbjazic | 0:9378fe6db796 | 25 | PinName g, |
tbjazic | 0:9378fe6db796 | 26 | PinName dp, |
tbjazic | 0:9378fe6db796 | 27 | ConnectionMode cm = CommonAnode); |
tbjazic | 0:9378fe6db796 | 28 | void init(); |
tbjazic | 0:9378fe6db796 | 29 | void print(char); |
tbjazic | 0:9378fe6db796 | 30 | private: |
tbjazic | 0:9378fe6db796 | 31 | BusInOut display; |
tbjazic | 0:9378fe6db796 | 32 | ConnectionMode mode; |
tbjazic | 0:9378fe6db796 | 33 | void turnOn(int); |
tbjazic | 0:9378fe6db796 | 34 | }; |
tbjazic | 0:9378fe6db796 | 35 | |
tbjazic | 0:9378fe6db796 | 36 | #endif |