mauricio cadena
/
Pote
REFRESCO DINAMICO CON DISPLAY 7 SEGMENTOS
katodo.cpp@1:938f080c6be8, 2017-08-19 (annotated)
- Committer:
- mauricio1989
- Date:
- Sat Aug 19 21:54:24 2017 +0000
- Revision:
- 1:938f080c6be8
REFRESCO DINAMICO CON DISPLAYS 7 SEGMENTOS
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mauricio1989 | 1:938f080c6be8 | 1 | #include "katodo.h" |
mauricio1989 | 1:938f080c6be8 | 2 | |
mauricio1989 | 1:938f080c6be8 | 3 | int kato[17]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67,0x77,0x7c,0x74,0x5c,0x30,0x5f}; |
mauricio1989 | 1:938f080c6be8 | 4 | int katodo::entrada(PinName a,PinName b,PinName c,PinName d) |
mauricio1989 | 1:938f080c6be8 | 5 | |
mauricio1989 | 1:938f080c6be8 | 6 | { |
mauricio1989 | 1:938f080c6be8 | 7 | BusIn dip(a,b,c,d); |
mauricio1989 | 1:938f080c6be8 | 8 | dipp=dip.read(); |
mauricio1989 | 1:938f080c6be8 | 9 | return dipp; |
mauricio1989 | 1:938f080c6be8 | 10 | } |
mauricio1989 | 1:938f080c6be8 | 11 | |
mauricio1989 | 1:938f080c6be8 | 12 | void katodo::visual(PinName a,PinName b,PinName c,PinName d,PinName e,PinName f,PinName g) |
mauricio1989 | 1:938f080c6be8 | 13 | { |
mauricio1989 | 1:938f080c6be8 | 14 | _a=a;_b=b;_c=c;_d=d;_e=e;_f=f;_g=g; |
mauricio1989 | 1:938f080c6be8 | 15 | } |
mauricio1989 | 1:938f080c6be8 | 16 | |
mauricio1989 | 1:938f080c6be8 | 17 | void katodo::bcd(int numero) |
mauricio1989 | 1:938f080c6be8 | 18 | |
mauricio1989 | 1:938f080c6be8 | 19 | { |
mauricio1989 | 1:938f080c6be8 | 20 | BusOut display(_g,_f,_e,_d,_c,_b,_a); |
mauricio1989 | 1:938f080c6be8 | 21 | display=kato[numero]; |
mauricio1989 | 1:938f080c6be8 | 22 | } |
mauricio1989 | 1:938f080c6be8 | 23 | void katodo::dual(PinName one,PinName two,int uni,int dec,int time) |
mauricio1989 | 1:938f080c6be8 | 24 | { |
mauricio1989 | 1:938f080c6be8 | 25 | DigitalOut Eone(one); |
mauricio1989 | 1:938f080c6be8 | 26 | DigitalOut Etwo(two); |
mauricio1989 | 1:938f080c6be8 | 27 | for(int u=0;u<time;u++) |
mauricio1989 | 1:938f080c6be8 | 28 | { |
mauricio1989 | 1:938f080c6be8 | 29 | Eone=1; |
mauricio1989 | 1:938f080c6be8 | 30 | Etwo=0; |
mauricio1989 | 1:938f080c6be8 | 31 | bcd(uni); |
mauricio1989 | 1:938f080c6be8 | 32 | wait(0.0005); |
mauricio1989 | 1:938f080c6be8 | 33 | Eone=0; |
mauricio1989 | 1:938f080c6be8 | 34 | Etwo=1; |
mauricio1989 | 1:938f080c6be8 | 35 | bcd(dec); |
mauricio1989 | 1:938f080c6be8 | 36 | wait(0.0005); |
mauricio1989 | 1:938f080c6be8 | 37 | } |
mauricio1989 | 1:938f080c6be8 | 38 | } |
mauricio1989 | 1:938f080c6be8 | 39 |