#include <LPC21xx.H>
#define s 0x00000080 //assigning P0.7 as s
void delay(int);
void delay(int m)
{
while(m--);
}
int main()
{
IO0DIR |=(1<<6);
//IO0DIR |= ~(1<<7);
IO0DIR &= ~(s);
IO0SET|=(1<<6);
delay(650000);
IO0CLR |=(1<<6);
while(1)
{
IO0CLR |=(1<<6);
//while(IO0PIN& (1<<7))
while(IO0PIN& (s))
{
IO0SET|=(1<<6);
}
}
}
#define s 0x00000080 //assigning P0.7 as s
void delay(int);
void delay(int m)
{
while(m--);
}
int main()
{
IO0DIR |=(1<<6);
//IO0DIR |= ~(1<<7);
IO0DIR &= ~(s);
IO0SET|=(1<<6);
delay(650000);
IO0CLR |=(1<<6);
while(1)
{
IO0CLR |=(1<<6);
//while(IO0PIN& (1<<7))
while(IO0PIN& (s))
{
IO0SET|=(1<<6);
}
}
}
No comments:
Post a Comment