Marvin Villamizar
/
Discrete_SevenSegment_A_K
An awesome library for the 7 segment displays.
Revision 1:4aefe4ad20a6, committed 2016-02-13
- Comitter:
- dimmu8410
- Date:
- Sat Feb 13 17:06:18 2016 +0000
- Parent:
- 0:916a5376859c
- Commit message:
- A library for the seven segments Displays, it doesn't matter if you have and Anode or Cathode displays, you can use Both with this library.
Changed in this revision
diff -r 916a5376859c -r 4aefe4ad20a6 main.cpp --- a/main.cpp Thu Feb 11 18:16:47 2016 +0000 +++ b/main.cpp Sat Feb 13 17:06:18 2016 +0000 @@ -8,10 +8,10 @@ disp.conf(PA_0,PA_1,PA_4,PB_0,PC_1,PC_0,PA_10); while(1) { - for(int i=0;i<10;i++) + for(int i=0;i<20;i++) { disp.printA(i); - wait(1); + wait(0.25); } } } \ No newline at end of file
diff -r 916a5376859c -r 4aefe4ad20a6 seven.cpp --- a/seven.cpp Thu Feb 11 18:16:47 2016 +0000 +++ b/seven.cpp Sat Feb 13 17:06:18 2016 +0000 @@ -1,7 +1,8 @@ #include "seven.h" #include "mbed.h" -int _decoK[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67}; -int _decoA[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98}; + + int _decoK[20]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67,0x77,0xfc,0x39,0x5e,0x79,0x71,0x74,0x5c,0x38,0x77}; + int _decoA[20]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98,0x88,0x03,0xc6,0xa1,0x86,0x8E,0x8b,0xa3,0xc7,0x88}; void seven::conf(PinName pin1,PinName pin2,PinName pin3,PinName pin4,PinName pin5,PinName pin6,PinName pin7) {
diff -r 916a5376859c -r 4aefe4ad20a6 seven.h --- a/seven.h Thu Feb 11 18:16:47 2016 +0000 +++ b/seven.h Sat Feb 13 17:06:18 2016 +0000 @@ -3,17 +3,21 @@ #include "mbed.h" + class seven { + public: void conf(PinName pin1,PinName pin2,PinName pin3,PinName pin4,PinName pin5,PinName pin6,PinName pin7); void printA(int number); void printK(int number2); + private: PinName _pin1;PinName _pin2;PinName _pin3;PinName _pin4;PinName _pin5;PinName _pin6;PinName _pin7; int _number;int _number2; + }; #endif \ No newline at end of file