Monday, February 11, 2019
โครงงานที24
code
void beep(void);
main()
{
int time1,time2;
TRISB = 0xF0;
while(1)
{
PORTB.F1=0;
PORTB.F2=0;
PORTB.F3=0;
while(~PORTB.F4&PORTB.F5&PORTB.F6)
{
PORTB.F1=1;
PORTB.F2=0;
PORTB.F3=0;
for(time1=0;time1<20000;time1++)
{
while(PORTB.F4&~PORTB.F5&PORTB.F6)
{
PORTB.F1=1;
PORTB.F2=1;
PORTB.F3=0;
for(time2=0;time2<10000;time2++)
{
while(PORTB.F4&PORTB.F5&~PORTB.F6)
{
PORTB.F1=1;
PORTB.F2=1;
PORTB.F3=1;
beep();
Delay_ms(1000);
}
}
}
}
}
}
}
void beep(void)
{
int i ;
for(i=0;i<200;i++)
{
PORTB.F0=1;
Delay_us(200);
PORTB.F0=0;
Delay_us(200);
}
}
Subscribe to:
Post Comments (Atom)
สรุปงานที่ 5 Internet of Things (IoT)
Internet of Things (IoT) คืออะไร Internet of Things (IoT) คือ "อินเตอร์เน็ตในทุกสิ่ง" หมายถึง การที่อุปกรณ์ต่างๆ ส...
-
Digital Speedometer and Odometer Circuit using PIC Microcontroller EMBEDDED By Aswinth Raj Jul 27, 2017 24 Digital Speedometer and...
-
How to Save Data using EEPROM in PIC16F877A Microcontroller By Aswinth Raj Aug 10, 2017 2 Saving Data using...
-
Generating PWM using PIC Microcontroller with MPLAB and XC8 EMBEDDED By Aswinth Raj Mar 15, 2017 35 Generating PWM using PIC Micr...
No comments:
Post a Comment