Wednesday, December 26, 2018
T14
#define r1 PORTB.F0
#define r2 PORTB.F1
#define r3 PORTB.F2
#define r4 PORTB.F3
#define r5 PORTB.F4
#define r6 PORTB.F5
#define r7 PORTB.F6
#define r8 PORTB.F7
#define c1 PORTC.F0
#define c2 PORTC.F1
#define c3 PORTC.F2
#define c4 PORTC.F3
#define c5 PORTC.F4
#define c6 PORTC.F5
#define c7 PORTC.F6
#define c8 PORTC.F7
void delay_reset()
{
delay_ms(5);
PORTC=0;PORTB=0xFF;
}
void main()
{
TRISB=0;
TRISC=0;
PORTC=0;PORTB=0xFF;
while(1)
{
c4=1;r4=0;r5=0;delay_reset();
c5=1;r4=0;r5=0;delay_reset();
delay_ms(100);
c3=1;PORTB=0xC3;delay_reset();
c4=1;r3=0;r6=0;delay_reset();
c5=1;r3=0;r6=0;delay_reset();
c6=1;PORTB=0xC3;delay_reset();
delay_ms(100);
c2=1;PORTB=0x81;delay_reset();
c3=1;r2=0;r7=0;delay_reset();
c4=1;r2=0;r7=0;delay_reset();
c5=1;r2=0;r7=0;delay_reset();
c6=1;r2=0;r7=0;delay_reset();
c7=1;PORTB=0x81;delay_reset();
delay_ms(100);
c1=1;PORTB=0;delay_reset();
c2=1;r1=0;r8=0;delay_reset();
c3=1;r1=0;r8=0;delay_reset();
c4=1;r1=0;r8=0;delay_reset();
c5=1;r1=0;r8=0;delay_reset();
c6=1;r1=0;r8=0;delay_reset();
c7=1;r1=0;r8=0;delay_reset();
c8=1;PORTB=0;delay_reset();
delay_ms(100);
}
}
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