Professional Documents
Culture Documents
Led
Led
H>
sbit sw1=P1^0;
sbit sw2=P1^1;
sbit led=P1^2;
void delay()
{
int k,j;
for(k=0;k<=32000;k++) 0001231
{
while(j<2)
{j++;
}
}
}
void main()
{
int a[]={0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff},j;12121
P1=0x00;
P2=0x00;
while(1>0)
{
if(sw1==1)
{
if(j>=8)
{
j=7;
}
j++;
P2=a[j];
if(j>0)
{
led=1;
}
delay();
}
if(sw2==1)
{
if(j<=0)
{
j=1;
}
j--;
P2=a[j];
if(j<=0)
{
led=0;
}
delay();
}
}
}
8051 compiler
From Wikipedia, the free encyclopedia
There are various high level language compilers for 8051 or enhanced versions of
8051 from various vendors. The most popular is the C language compiler. As the
modern C compilers are efficient, assembly language is seldom used nowadays[cita
Recent changes
Contact page
Tools
What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Wikidata item
Cite this page
Print/export
Create a book
Download as PDF
Printable version
Languages
Edit links
This page was last modified on 13 April 2014 at 22:34.
Text is available under the Creative Commons Attribution-ShareAlike License; add
itional terms may apply. By using this site, you agree to the Terms of Use and P
rivacy Policy. Wikipedia is a registered trademark of the Wikimedia Foundation, I
nc., a non-profit organization.
Privacy policyAbout WikipediaDisclaimersContact WikipediaDevelopersMobile viewWi
kimedia Foundation Powered by MediaWiki