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.
BDCSEG.cpp@0:a70d5bbd557c, 2017-08-19 (annotated)
- Committer:
- LCRodriguez
- Date:
- Sat Aug 19 21:51:03 2017 +0000
- Revision:
- 0:a70d5bbd557c
Volti7Seg
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| LCRodriguez | 0:a70d5bbd557c | 1 | #include "BCDSEG.h" |
| LCRodriguez | 0:a70d5bbd557c | 2 | |
| LCRodriguez | 0:a70d5bbd557c | 3 | int An[10]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x58,0x00,0x18}; |
| LCRodriguez | 0:a70d5bbd557c | 4 | int And::entrada(PinName a,PinName b,PinName c,PinName d) |
| LCRodriguez | 0:a70d5bbd557c | 5 | { |
| LCRodriguez | 0:a70d5bbd557c | 6 | BusIn dip(a,b,c,d); |
| LCRodriguez | 0:a70d5bbd557c | 7 | dipS=dip.read(); |
| LCRodriguez | 0:a70d5bbd557c | 8 | return dipS; |
| LCRodriguez | 0:a70d5bbd557c | 9 | } |
| LCRodriguez | 0:a70d5bbd557c | 10 | void And::ve(PinName a,PinName b,PinName c,PinName d,PinName e,PinName f,PinName g) |
| LCRodriguez | 0:a70d5bbd557c | 11 | { |
| LCRodriguez | 0:a70d5bbd557c | 12 | a_=a;b_=b;c_=c;d_=d;e_=e;f_=f;g_=g; |
| LCRodriguez | 0:a70d5bbd557c | 13 | |
| LCRodriguez | 0:a70d5bbd557c | 14 | } |
| LCRodriguez | 0:a70d5bbd557c | 15 | void And::bcd(int number) |
| LCRodriguez | 0:a70d5bbd557c | 16 | { |
| LCRodriguez | 0:a70d5bbd557c | 17 | BusOut display(g_,f_,e_,d_,c_,b_,a_); |
| LCRodriguez | 0:a70d5bbd557c | 18 | display=An[number]; |
| LCRodriguez | 0:a70d5bbd557c | 19 | } |
| LCRodriguez | 0:a70d5bbd557c | 20 | void And::doble(PinName uno, PinName dos, int Uni, int Dec,int time) |
| LCRodriguez | 0:a70d5bbd557c | 21 | { |
| LCRodriguez | 0:a70d5bbd557c | 22 | DigitalOut Euno(uno); |
| LCRodriguez | 0:a70d5bbd557c | 23 | DigitalOut Edos(dos); |
| LCRodriguez | 0:a70d5bbd557c | 24 | for(int x=0;x<time;x++) |
| LCRodriguez | 0:a70d5bbd557c | 25 | { |
| LCRodriguez | 0:a70d5bbd557c | 26 | Euno=1; |
| LCRodriguez | 0:a70d5bbd557c | 27 | Edos=0; |
| LCRodriguez | 0:a70d5bbd557c | 28 | bcd(Uni); |
| LCRodriguez | 0:a70d5bbd557c | 29 | wait(0.0005); |
| LCRodriguez | 0:a70d5bbd557c | 30 | Euno=0; |
| LCRodriguez | 0:a70d5bbd557c | 31 | Edos=1; |
| LCRodriguez | 0:a70d5bbd557c | 32 | bcd(Dec); |
| LCRodriguez | 0:a70d5bbd557c | 33 | wait(0.0005); |
| LCRodriguez | 0:a70d5bbd557c | 34 | } |
| LCRodriguez | 0:a70d5bbd557c | 35 | } |