Wednesday, December 26, 2018
T11
void timer0_setup()
{
T0CON.TMR0ON=0;
INTCON.TMR0IF=0;
TMR0H=0xC2;
TMR0L=0xF7;
T0CON.TMR0ON=1;
}
void main()
{
TRISC=0;
TRISD=0xFF;
T0CON=0x05;
Lcd_Init(&PORTC);
Keypad_Init(&PORTD);
Lcd_Cmd(LCD_CURSOR_OFF);
Lcd_Cmd(LCD_CLEAR);
Lcd_Chr(1,1,'3');
timer0_setup();
while(INTCON.TMR0IF==0)
{
if(Keypad_Read()==3)
{
Lcd_Chr(1,1,' ');
break;
}
}
Lcd_Chr(2,5,'6');
timer0_setup();
while(INTCON.TMR0IF==0)
{
if(Keypad_Read()==7)
{
Lcd_Chr(2,5,' ');
break;
}
}
Lcd_Chr(1,9,'8');
timer0_setup();
while(INTCON.TMR0IF==0)
{
if(Keypad_Read()==10)
{
Lcd_Chr(1,9,' ');
break;
}
}
Lcd_Chr(2,16,'0');
timer0_setup();
while(INTCON.TMR0IF==0)
{
if(Keypad_Read()==14)
{
Lcd_Chr(2,16,' ');
break;
}
}
Lcd_Chr(2,1,'7');
timer0_setup();
while(INTCON.TMR0IF==0)
{
if(Keypad_Read()==9)
{
Lcd_Chr(2,1,' ');
break;
}
}
Lcd_Chr(1,12,'4');
timer0_setup();
while(INTCON.TMR0IF==0)
{
if(Keypad_Read()==5)
{
Lcd_Chr(1,12,' ');
break;
}
}
Lcd_Chr(2,9,'1');
timer0_setup();
while(INTCON.TMR0IF==0)
{
if(Keypad_Read()==1)
{
Lcd_Chr(2,9,' ');
break;
}
}
Lcd_Chr(1,16,'5');
timer0_setup();
while(INTCON.TMR0IF==0)
{
if(Keypad_Read()==6)
{
Lcd_Chr(1,16,' ');
break;
}
}
Lcd_Chr(1,5,'9');
timer0_setup();
while(INTCON.TMR0IF==0)
{
if(Keypad_Read()==11)
{
Lcd_Chr(1,5,' ');
break;
}
}
Lcd_Chr(2,12,'2');
timer0_setup();
while(INTCON.TMR0IF==0)
{
if(Keypad_Read()==2)
{
Lcd_Chr(1,12,' ');
break;
}
}
}
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