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.
SegDisplay.cpp@1:d1e0d33bb542, 2022-11-30 (annotated)
- Committer:
- jd12345
- Date:
- Wed Nov 30 22:16:35 2022 +0000
- Revision:
- 1:d1e0d33bb542
- Parent:
- 0:805e0c86042b
Programski zadatak iz kolegija Mikroupravljaci
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| jd12345 | 1:d1e0d33bb542 | 1 | |
| jd12345 | 0:805e0c86042b | 2 | #include "SegDisplay.h" |
| jd12345 | 1:d1e0d33bb542 | 3 | BusOut Seg1(D2,D3,D4,D5,D6,D7,D8,D9); //definiranje sabirnice A,B,C,D,E,F,G,DP |
| jd12345 | 0:805e0c86042b | 4 | |
| jd12345 | 0:805e0c86042b | 5 | void SegInit(void) { |
| jd12345 | 1:d1e0d33bb542 | 6 | Seg1=SegConvert(0); // inicijalizacija na 0 |
| jd12345 | 0:805e0c86042b | 7 | } |
| jd12345 | 1:d1e0d33bb542 | 8 | char SegConvert(char SegValue) { // funkcija 'SegConvert' |
| jd12345 | 0:805e0c86042b | 9 | char SegByte=0x00; |
| jd12345 | 0:805e0c86042b | 10 | switch (SegValue) { //DP G F E D C B A |
| jd12345 | 1:d1e0d33bb542 | 11 | case 0 : SegByte = 0x3F; break; // 0 0 1 1 1 1 1 1 |
| jd12345 | 1:d1e0d33bb542 | 12 | case 1 : SegByte = 0x06; break; // 0 0 0 0 0 1 1 0 |
| jd12345 | 1:d1e0d33bb542 | 13 | case 2 : SegByte = 0x5B; break; // 0 1 0 1 1 0 1 1 |
| jd12345 | 1:d1e0d33bb542 | 14 | case 3 : SegByte = 0x4F; break; // 0 1 0 0 1 1 1 1 |
| jd12345 | 1:d1e0d33bb542 | 15 | case 4 : SegByte = 0x66; break; // 0 1 1 0 0 1 1 0 |
| jd12345 | 1:d1e0d33bb542 | 16 | case 5 : SegByte = 0x6D; break; // 0 1 1 0 1 1 0 1 |
| jd12345 | 1:d1e0d33bb542 | 17 | case 6 : SegByte = 0x7D; break; // 0 1 1 1 1 1 0 1 |
| jd12345 | 1:d1e0d33bb542 | 18 | case 7 : SegByte = 0x07; break; // 0 0 0 0 0 1 1 1 |
| jd12345 | 1:d1e0d33bb542 | 19 | case 8 : SegByte = 0x7F; break; // 0 1 1 1 1 1 1 1 |
| jd12345 | 1:d1e0d33bb542 | 20 | case 9 : SegByte = 0x6F; break; // 0 1 1 0 1 1 1 1 |
| jd12345 | 0:805e0c86042b | 21 | } |
| jd12345 | 0:805e0c86042b | 22 | return SegByte; |
| jd12345 | 0:805e0c86042b | 23 | } |