Arvind Electrical
Pages
Home
Saturday, 11 June 2011
switch and LED
#include<reg51.h>
#define led P0
sbit s1=P1^0;
sbit s2=P1^1;
void main()
{
P0=0xff;
while(1)
{
if (s1==0)
{
led=0x33;
P1=0xff;
}
else if(s2==0)
{
led=0xcc;
P1=0xff;
}
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment