Wednesday, December 26, 2018
T5
unsigned char segment[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
unsigned char i1,i2,i3,i4,i5,i6;
void interrupt()
{
i6++;
if(i6>9)
{
i6=0;
i5++;
}
if(i5>9)
{
i5=0;
i4++;
}
if(i4>9)
{
i4=0;
i3++;
}
if(i3>9)
{
i3=0;
i2++;
}
if(i2>9)
{
i2=0;
i1++;
}
if(i1>9)i1=0;
INTCON.INT0IF=0;
}
void main()
{
TRISB=0xFF;
TRISC=0;
TRISD=0;
INTCON.INT0IE=1;
INTCON.INT0IF=0;
INTCON2.INTEDG0=0;
INTCON.GIE=1;
while(1)
{
PORTD=0xDF;
PORTC=segment[i1];
delay_ms(10);
PORTD=0xEF;
PORTC=segment[i2];
delay_ms(10);
PORTD=0xF7;
PORTC=segment[i3];
delay_ms(10);
PORTD=0xFB;
PORTC=segment[i4];
delay_ms(10);
PORTD=0xFD;
PORTC=segment[i5];
delay_ms(10);
PORTD=0xFE;
PORTC=segment[i6];
delay_ms(10);
}
}
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