flame sensor interfacing with pic microcontroller
code
void main(void)
{
PORTD.B0=0;
TRISD.B0=1; // PIN NUMBER 1 IS DECLARED AS A INPUT
PORTE.B0=0;
TRISE.B0=0; // PIN NUMBER 1 IS DECLARED AS A OUTPUT
while(1) { // Endless loop
if( PORTD.B0==1)
{
PORTE.B0=1; // it will make buzzer on
}
else
{
PORTE.B0=0; // it will make buzzer off
}
}
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น