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.
Revision 1:fc4f81779ab2, committed 2021-11-06
- Comitter:
- miroljubmicic
- Date:
- Sat Nov 06 09:24:16 2021 +0000
- Parent:
- 0:f47d9cc84f81
- Commit message:
- Miroljub Micic 514/2018
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Nov 06 08:15:23 2021 +0000 +++ b/main.cpp Sat Nov 06 09:24:16 2021 +0000 @@ -17,7 +17,7 @@ { if (SW1 == 0) { - brojac += 1; + brojac = brojac + 1; wait_ms(500); } if (brojac == 0) @@ -72,14 +72,63 @@ } if (brojac == 10) { - //SEL1.write(0x79); //1 na levom sedmosegmentnom displeju - //displej.write(0x10); //0 na desnom sedmosegmentnom displeju + SEL1.write(0); + displej.write(0x79); //1 na levom sedmosegmentnom displeju + wait_ms(10); + SEL2.write(0); + displej.write(0xC0); //0 na desnom sedmosegmentnom displeju + wait_ms(10); + } + if (brojac == 11) + { + SEL1.write(0); + displej.write(0x79); //1 na levom sedmosegmentnom displeju + wait_ms(10); + SEL2.write(0); + displej.write(0x79); //1 na desnom sedmosegmentnom displeju + wait_ms(10); + } + if (brojac == 12) + { + SEL1.write(0); + displej.write(0x79); //1 na levom sedmosegmentnom displeju + wait_ms(10); + SEL2.write(0); + displej.write(0x24); //2 na desnom sedmosegmentnom displeju + wait_ms(10); } - if (brojac>=15) + if (brojac == 13) + { + SEL1.write(0); + displej.write(0x79); //1 na levom sedmosegmentnom displeju + wait_ms(10); + SEL2.write(0); + displej.write(0x30); //3 na desnom sedmosegmentnom displeju + wait_ms(10); + } + if (brojac == 14) + { + SEL1.write(0); + displej.write(0x79); //1 na levom sedmosegmentnom displeju + wait_ms(10); + SEL2.write(0); + displej.write(0x19); //4 na desnom sedmosegmentnom displeju + wait_ms(10); + } + if (brojac == 15) + { + SEL1.write(0); + displej.write(0x79); //1 na levom sedmosegmentnom displeju + wait_ms(10); + SEL2.write(0); + displej.write(0x12); //5 na desnom sedmosegmentnom displeju + wait_ms(10); + } + if (brojac>15) brojac = 0; } } -/*komentar +/* 0x3F, 0xC0 //0111111 NULA 0x06, 0x79 //0000110 JEDAN 0x5B, 0x24 //1011011 DVA @@ -90,5 +139,5 @@ 0x07, 0x78 //0000111 SEDAM 0x7F, 0x0 //1111111 OSAM 0x6F, 0x10 //1101111 DEVET -0x00 0x7F //0000000 UGASI +0x00, 0x7F //0000000 UGASI */ \ No newline at end of file