Last active
August 27, 2016 08:01
-
-
Save SaheblalBagwan/efc062c8c676a9a3575b9de450debaed 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
#include <reg51.h> | |
void DELAY_ms(unsigned int ms_Count) | |
{ | |
unsigned int i,j; | |
for(i=0;i<ms_Count;i++) | |
{ | |
for(j=0;j<100;j++); | |
} | |
} | |
int main() { | |
char seg_code[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; | |
int i; | |
while (1) | |
{ | |
for (i = 0; i <= 9; i++) // loop to display 0-9 | |
{ | |
P2 = seg_code[i]; | |
DELAY_ms(1000); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment