Created
December 8, 2016 13:28
-
-
Save jimmisitepu/387d4b6f680e6d57167becf5674f7a03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void display7segment(){ | |
uint8_t i;uint32_t R; | |
uint8_t S; | |
R=harga; | |
for(i=0;i<6;i++){ | |
S=R%10; | |
if(R!=0||i==0)display7(S,i); | |
R=R/10; | |
} | |
R=volume/10; | |
for(i=6;i<11;i++){ | |
S=R%10; | |
if(R!=0||i<9)display7(S,i); | |
R=R/10; | |
} | |
R=harga_perliter; | |
for(i=11;i<16;i++){ | |
S=R%10; | |
if(R!=0||i==11)display7(S,i); | |
R=R/10; | |
} | |
display7(15,10); | |
} | |
void display7(uint8_t nilai,uint8_t pos){ | |
PORTB=0x00; | |
PORTB=nilai|pos<<4; | |
delay_us(1500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment