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.
Diff: Function1.h
- Revision:
- 0:52fb551ac065
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Function1.h Thu Jan 22 01:06:03 2015 +0000 @@ -0,0 +1,59 @@ +/* + Function 1: take a decimal digit (0, 1, 2, ... , 9) and return the segment driver value for this digit + +*/ + +BusOut digselect(p20, p19, p15, p13, p24); +// bus from MSB to LSB: L1/L2, digit4, digit3, digit2, digit1 + +BusOut digit(p26, p28, p25, p18, p16, p23, p27, p14); +// bus from MSB to LSB: dp, g, f, e, d, c, b, a + + +DigitalOut L1(p17); +//DigitalOut L2(p24); + +void digit0 () { +digit = 0xC0; +}; + +void digit1 () { +digit = 0xF9; +}; + +void digit2 () { +//digit = 0x24; +digit = 0xA4; +}; + +void digit3 () { +digit = 0xB0; +}; + +void digit4 () { +digit = 0x99; +}; + +void digit5 () { +digit = 0x92; +}; + +void digit6 () { +digit = 0x82; +}; + +void digit7 () { +digit = 0xF8; +}; + +void digit8 () { +digit = 0x80; +}; + +void digit9 () { +digit = 0x98; +}; + +void digit00 () { +digit = 0xFF; +};