int Read_T(void);
void alarm (void);
main()
{
TRISB = 0xF0;
CMCON = 0x07;
while(1)
{
while(Read_T()<10)
{
alarm();
}
}
}
int Read_T(void)
{
int i;
i =0;
TRISA = 0xF0;
PORTA.F0 = 1;
Delay_ms(10);
TRISA = 0xF1;
while(PORTA.F0 == 1)
{
i++;
}
i = i/10;
return i ;
}
void alarm(void)
{
int i ;
PORTB.F1 = 1;
for (i=0;i<200;i++)
{
PORTB.F0=1;
Delay_us(200);
PORTB.F0=0;
Delay_us(200);
}
PORTB.F1=0;
for (i=0;i<200;i++)
{
PORTB.F0;
Delay_us(200);
}
}
วันศุกร์ที่ 8 กุมภาพันธ์ พ.ศ. 2562
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
Internet of Things (IoT)
Internet of Things หรือ IoT Internet of Things (IoT) คือ การที่อุปกรณ์อิเล็กทรอนิกส์ต่างๆ สามารถเชื่อมโยงหรือส่งข้อมูลถึงกันได้ด้วยอิ...
-
Calculator with Pic 16f877 microcontroller is a comprehensive project. Comprehensive in the w...
-
Internet of Things หรือ IoT Internet of Things (IoT) คือ การที่อุปกรณ์อิเล็กทรอนิกส์ต่างๆ สามารถเชื่อมโยงหรือส่งข้อมูลถึงกันได้ด้วยอิ...
-
#include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); int PIRpin = 8; void setup() { lcd.begin(); pinMode(PIRpin,...
ไม่มีความคิดเห็น:
แสดงความคิดเห็น