//programa decodificado de BCD a decimal mediante dip swicth
Fork of Deco_Katodo by
katodo.cpp@1:0b8fe27ace28, 2017-08-12 (annotated)
- Committer:
- mauricio1989
- Date:
- Sat Aug 12 21:25:21 2017 +0000
- Revision:
- 1:0b8fe27ace28
- Parent:
- 0:e4c3edb3c5ea
//programa decodificado de BCD a decimal mediante dip swicth
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dimmu8410 | 0:e4c3edb3c5ea | 1 | #include "katodo.h" |
dimmu8410 | 0:e4c3edb3c5ea | 2 | |
mauricio1989 | 1:0b8fe27ace28 | 3 | int kato[16]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67,0x77,0x7c,0x74,0x5c,0x30,0x5f}; |
mauricio1989 | 1:0b8fe27ace28 | 4 | int katodo::entrada(PinName a,PinName b,PinName c,PinName d) |
dimmu8410 | 0:e4c3edb3c5ea | 5 | |
dimmu8410 | 0:e4c3edb3c5ea | 6 | { |
mauricio1989 | 1:0b8fe27ace28 | 7 | BusIn dip(a,b,c,d); |
mauricio1989 | 1:0b8fe27ace28 | 8 | dipSw=dip.read(); |
mauricio1989 | 1:0b8fe27ace28 | 9 | return dipSw; |
dimmu8410 | 0:e4c3edb3c5ea | 10 | } |
mauricio1989 | 1:0b8fe27ace28 | 11 | |
mauricio1989 | 1:0b8fe27ace28 | 12 | void katodo::visual(PinName a,PinName b,PinName c,PinName d,PinName e,PinName f,PinName g) |
dimmu8410 | 0:e4c3edb3c5ea | 13 | { |
mauricio1989 | 1:0b8fe27ace28 | 14 | _a=a;_b=b;_c=c;_d=d;_e=e;_f=f;_g=g; |
mauricio1989 | 1:0b8fe27ace28 | 15 | } |
mauricio1989 | 1:0b8fe27ace28 | 16 | |
mauricio1989 | 1:0b8fe27ace28 | 17 | void katodo::bcd(int numero) |
dimmu8410 | 0:e4c3edb3c5ea | 18 | |
mauricio1989 | 1:0b8fe27ace28 | 19 | { |
mauricio1989 | 1:0b8fe27ace28 | 20 | BusOut display(_g,_f,_e,_d,_c,_b,_a); |
mauricio1989 | 1:0b8fe27ace28 | 21 | display=kato[numero]; |
dimmu8410 | 0:e4c3edb3c5ea | 22 | } |