Heart-Shaped LEDs

Heart-shaped LEDs

     My third microcontroller hobby project was dedicated to Jesus’ birthday since he helped me on my previous projects. I love lights so I created this simple project of mine. It is composed of 34 LEDs soldered in a heart shape figure. It comes in over 25 unique patterns. I utilized MikroC PRO for PIC for programming in C language. In line C coding was used here.

The schematic is simple. Just connect all I/O pins in pic16f877a to a resistor and to an LED.

View the schematic here:

heart

     The PCB Layout is available on the sidebar. You can download it. Just look for “Heart-shaped LEDs PCB Layout” under Heart Shaped LEDs folder.
Here is the code and it is in mikroC PRO:

#define x1  porta.f0
#define x2  porta.f1
#define x3  porta.f2
#define x4  porta.f3
#define x5  porta.f5
#define x6  porte.f0
#define x7  porte.f1
#define x8  porte.f2
#define x9 portc.f0
#define x10 portc.f1
#define x11 portc.f2
#define x12 portc.f3
#define x13 portd.f0
#define x14 portd.f1
#define x15 portd.f2
#define x16 portd.f3
#define x17 portc.f4
#define x18 portc.f5
#define x19 portc.f6
#define x20 portc.f7
#define x21 portd.f4
#define x22 portd.f5
#define x23 portd.f6
#define x24 portd.f7
#define x25 portb.f0
#define x26 portb.f1
#define x27 portb.f2
#define x28 portb.f3
#define x29 portb.f4
#define x30 portb.f5
#define x31 portb.f6
#define x32 portb.f7

unsigned char new;

void init_all(void){
porta = 0;
portb = 0;
portc = 0;
portd = 0;
porte = 0;
adcon1 = 0x06;
cmcon = 0x07;
trisa= 0;
trisb = 0;
trisc = 0;
trisd = 0;
trise = 0;
}

void very_first(void){
x3 = 1;
delay_ms(2000);
x32 = 1;
delay_ms(2000);
x16 = 1;
delay_ms(2000);
x10 = 1;
delay_ms(2000);
x25 = 1;
delay_ms(2000);
x20 = 1;
delay_ms(2000);
x28 = 1;
delay_ms(2000);
x14 = 1;
delay_ms(2000);
x6 = 1;
delay_ms(1500);
x30 = 1;
delay_ms(1300);

}

void first_patta(void){                                  //1st pattern goes here
x1 = 1;
delay_ms(150);
x2 = 1;
delay_ms(150);
x3 = 1;
delay_ms(150);
x4 = 1;
delay_ms(150);
x5 = 1;
delay_ms(150);
x6 = 1;
delay_ms(150);
x7 = 1;
delay_ms(150);
x8 = 1;
delay_ms(150);
x9 = 1;
delay_ms(150);
x10 = 1;
delay_ms(150);
x11 = 1;
delay_ms(150);
x12 = 1;
delay_ms(150);
x13 = 1;
delay_ms(150);
x14 = 1;
delay_ms(150);
x15 = 1;
delay_ms(150);
x16 = 1;
delay_ms(150);
x17 = 1;
delay_ms(150);
x18 = 1;
delay_ms(150);
x19 = 1;
delay_ms(150);
x20 = 1;
delay_ms(150);
x21 = 1;
delay_ms(150);
x22 = 1;
delay_ms(150);
x23 = 1;
delay_ms(150);
x24 = 1;
delay_ms(150);
x25 = 1;
delay_ms(150);
x26 = 1;
delay_ms(150);
x27 = 1;
delay_ms(150);
x28 = 1;
delay_ms(150);
x29 = 1;
delay_ms(150);
x30 = 1;
delay_ms(150);
x31 = 1;
delay_ms(150);
x32 = 1;
delay_ms(150);

}

void first_pattb(void){
x1 = 0;
delay_ms(150);
x2 = 0;
delay_ms(150);
x3 = 0;
delay_ms(150);
x4 = 0;
delay_ms(150);
x5 = 0;
delay_ms(150);
x6 = 0;
delay_ms(150);
x7 = 0;
delay_ms(150);
x8 = 0;
delay_ms(150);
x9 = 0;
delay_ms(150);
x10 = 0;
delay_ms(150);
x11 = 0;
delay_ms(150);
x12 = 0;
delay_ms(150);
x13 = 0;
delay_ms(150);
x14 = 0;
delay_ms(150);
x15 = 0;
delay_ms(150);
x16 = 0;
delay_ms(150);
x17 = 0;
delay_ms(150);
x18 = 0;
delay_ms(150);
x19 = 0;
delay_ms(150);
x20 = 0;
delay_ms(150);
x21 = 0;
delay_ms(150);
x22 = 0;
delay_ms(150);
x23 = 0;
delay_ms(150);
x24 = 0;
delay_ms(150);
x25 = 0;
delay_ms(150);
x26 = 0;
delay_ms(150);
x27 = 0;
delay_ms(150);
x28 = 0;
delay_ms(150);
x29 = 0;
delay_ms(150);
x30 = 0;
delay_ms(150);
x31 = 0;
delay_ms(150);
x32 = 0;
delay_ms(150);
}

void second_patta(void){                                  //light all
porta = 0xFF;
portb = 0xFF;
portc = 0xFF;
portd = 0xFF;
porte = 0xFF;
}

void second_pattb(void){                                 //off all
porta = 0;
portb = 0;
portc = 0;
portd = 0;
porte = 0;
}
void third_patt(void){                                   //third pattern goes here

x17 = 1;
delay_ms(70);
x16 = 1;
x18 = 1;
delay_ms(70);
x15 = 1;
x19 = 1;
delay_ms(70);
x14 = 1;
x20 = 1;
delay_ms(70);
x13 = 1;
x21 = 1;
delay_ms(70);
x12 = 1;
x22 = 1;
delay_ms(70);
x11 = 1;
x23 = 1;
delay_ms(70);
x10 = 1;
x24 = 1;
delay_ms(70);
x9 = 1;
x25 = 1;
delay_ms(70);
x8 = 1;
x26 = 1;
delay_ms(70);
x7 = 1;
x27 = 1;
delay_ms(70);
x6 = 1;
x28 = 1;
delay_ms(70);
x5 = 1;
x29 = 1;
delay_ms(70);
x4 = 1;
x30 = 1;
delay_ms(60);
x3 = 1;
x31 = 1;
delay_ms(60);
x2 = 1;
x32 = 1;
delay_ms(60);
x1 = 1;
delay_ms(50);
x1 = 0;
delay_ms(50);
x2 = 0;
x32 = 0;
delay_ms(50);
x3 = 0;
x31 = 0;
delay_ms(50);
x4 = 0;
x30 = 0;
delay_ms(50);
x5 = 0;
x29 = 0;
delay_ms(50);
x6 = 0;
x28 = 0;
delay_ms(50);
x7 = 0;
x27 = 0;
delay_ms(50);
x8 = 0;
x26 = 0;
delay_ms(50);
x9 = 0;
x25 = 0;
delay_ms(50);
x10 = 0;
x24 = 0;
delay_ms(50);
x11 = 0;
x23 = 0;
delay_ms(50);
x12 = 0;
x22 = 0;
delay_ms(50);
x13 = 0;
x21 = 0;
delay_ms(40);
x14 = 0;
x20 = 0;
delay_ms(30);
x15 = 0;
x19 = 0;
delay_ms(30);
x16 = 0;
x18 = 0;
delay_ms(30);
x17 = 0;
delay_ms(20);
}

void fourth_patt(void){                                    //fourth pattern goes here

x1 = 1;
delay_ms(50);

x1 = 1;
x32 = 1;
delay_ms(50);

x1 = 1;
x32 = 1;
x31 = 1;
delay_ms(50);

x30 = 1;
x31 = 1;
x32 = 1;
x1 = 1;
delay_ms(50);

x29 = 1;
x30 = 1;
x31 = 1;
x32 = 1;
x1 = 1;
delay_ms(50);

x28 = 1;
x29 = 1;
x30 = 1;
x31 = 1;
x32 = 1;
x1 = 0;
delay_ms(50);

x27 = 1;
x28 = 1;
x29 = 1;
x30 = 1;
x31 = 1;
x32 = 0;
delay_ms(50);

x26 = 1;
x27 = 1;
x28 = 1;
x29 = 1;
x30 = 1;
x31 = 0;
delay_ms(50);

x25 = 1;
x26 = 1;
x27 = 1;
x28 = 1;
x29 = 1;
x30 = 0;
delay_ms(50);

x24 = 1;
x25 = 1;
x26 = 1;
x27 = 1;
x28 = 1;
x29 = 0;
delay_ms(50);

x23 = 1;
x24 = 1;
x25 = 1;
x26 = 1;
x27= 1;
x28 = 0;
delay_ms(50);

x22 = 1;
x23 = 1;
x24 = 1;
x25 = 1;
x26 = 1;
x27 = 0;
delay_ms(50);

x21 = 1;
x22 = 1;
x23 = 1;
x24 = 1;
x25 = 1;
x26 = 0;
delay_ms(50);

x20 = 1;
x21 = 1;
x22 = 1;
x23 = 1;
x24 = 1;
x25 = 0;
delay_ms(50);

x19 = 1;
x20 = 1;
x21 = 1;
x22 = 1;
x23 = 1;
x24 = 0;
delay_ms(50);

x18 = 1;
x19 = 1;
x20 = 1;
x21 = 1;
x22 = 1;
x23 = 0;
delay_ms(50);

x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 1;
x22 = 0;
delay_ms(100);

x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 0;
delay_ms(50);

x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 0;
delay_ms(50);

x15 = 1;
x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 0;
delay_ms(50);

x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
x18 = 1;
x19 = 0;
delay_ms(50);

x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
x18 = 0;
delay_ms(50);

x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 0;
delay_ms(50);

x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 0;
delay_ms(50);

x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 0;
delay_ms(50);

x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 0;
delay_ms(50);

x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 0;
delay_ms(50);

x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 0;
delay_ms(50);

x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 0;
delay_ms(50);

x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 0;
delay_ms(50);

x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 0;
delay_ms(100);

x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 0;
delay_ms(50);

x3 = 1;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 0;
delay_ms(50);

x2 = 1;
x3 = 1;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 0;
delay_ms(50);

x1 = 1;
x2 = 1;
x3 = 1;
x4 = 1;
x5 = 1;
x6 = 0;
delay_ms(50);

}
///////////////////////////////////////////////////////////////////////////////////////////////////////
void fifth_patt(){                                        //fifth pattern goes here

x1 = 1;
x2 = 1;
x3 = 1;
x4 = 1;
x5 = 1;
x6 = 1;
delay_ms(100);

x1 = 0;
x2 = 1;
x3 = 1;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
delay_ms(100);

x2 = 0;
x3 = 1;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
delay_ms(100);

x3 = 0;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
delay_ms(100);

x4 = 0;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
delay_ms(100);

x5 = 0;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
delay_ms(100);

x6 = 0;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
delay_ms(100);

x7 = 0;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
delay_ms(100);

x8 = 0;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
delay_ms(100);

x9 = 0;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
delay_ms(100);

x10 = 0;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
delay_ms(100);

x11 = 0;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
delay_ms(100);

x12 = 0;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
x18 = 1;
delay_ms(100);

x13 = 0;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
delay_ms(100);

x14 = 0;
x15 = 1;
x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
delay_ms(100);

x15 = 0;
x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 1;
delay_ms(100);

x16 = 0;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 1;
x22 = 1;
delay_ms(100);

x17 = 0;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 1;
x22 = 1;
x23 = 1;
delay_ms(100);

x18 = 0;
x19 = 1;
x20 = 1;
x21 = 1;
x22 = 1;
x23 = 1;
x24 = 1;
delay_ms(100);

x19 = 0;
x20 = 1;
x21 = 1;
x22 = 1;
x23 = 1;
x24 = 1;
x25 = 1;
delay_ms(100);

x20 = 0;
x21 = 1;
x22 = 1;
x23 = 1;
x24 = 1;
x25 = 1;
x26 = 1;
delay_ms(100);

x21 = 0;
x22 = 1;
x23 = 1;
x24 = 1;
x25 = 1;
x26 = 1;
x27 = 1;
delay_ms(100);

x22 = 0;
x23 = 1;
x24 = 1;
x25 = 1;
x26 = 1;
x27 = 1;
x28 = 1;
delay_ms(100);

x23 = 0;
x24 = 1;
x25 = 1;
x26 = 1;
x27 = 1;
x28 = 1;
x29 = 1;
delay_ms(100);

x24 = 0;
x25 = 1;
x26 = 1;
x27 = 1;
x28 = 1;
x29 = 1;
x30 = 1;
delay_ms(100);

x25 = 0;
x26 = 1;
x27 = 1;
x28 = 1;
x29 = 1;
x30 = 1;
x31 = 1;
delay_ms(100);

x26 = 0;
x27 = 1;
x28 = 1;
x29 = 1;
x30 = 1;
x31 = 1;
x32 = 1;
delay_ms(100);

x27 = 0;
x28 = 1;
x29 = 1;
x30 = 1;
x31 = 1;
x32 = 1;
x1 = 1;
delay_ms(100);
}

void sixth_patt(){                                      // six pattern goes here

x27 = 1;
x28 = 1;
x29 = 1;
x30 = 1;
x31 = 1;
x32 = 1;
x1 = 1;
delay_ms(100);

x26 = 1;
x27 = 1;
x28 = 1;
x29 = 1;
x30 = 1;
x31 = 1;
x32 = 1;
x1 = 0;
delay_ms(100);

x25 = 1;
x26 = 1;
x27 = 1;
x28 = 1;
x29 = 1;
x30 = 1;
x31 = 1;
x32 = 0;
delay_ms(100);

x24 = 1;
x25 = 1;
x26 = 1;
x27 = 1;
x28 = 1;
x29 = 1;
x30 = 1;
x31 = 0;
delay_ms(100);

x23 = 1;
x24 = 1;
x25 = 1;
x26 = 1;
x27 = 1;
x28 = 1;
x29 = 1;
x30 = 0;
delay_ms(100);

x22 = 1;
x23 = 1;
x24 = 1;
x25 = 1;
x26 = 1;
x27 = 1;
x28 = 1;
x29 = 0;
delay_ms(100);

x21 = 1;
x22 = 1;
x23 = 1;
x24 = 1;
x25 = 1;
x26 = 1;
x27 = 1;
x28 = 0;
delay_ms(100);

x20 = 1;
x21 = 1;
x22 = 1;
x23 = 1;
x24 = 1;
x25 = 1;
x26 = 1;
x27 = 0;
delay_ms(100);

x19 = 1;
x20 = 1;
x21 = 1;
x22 = 1;
x23 = 1;
x24 = 1;
x25 = 1;
x26 = 0;
delay_ms(100);

x18 = 1;
x19 = 1;
x20 = 1;
x21 = 1;
x22 = 1;
x23 = 1;
x24 = 1;
x25 = 0;
delay_ms(100);

x1 = 1;

x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 1;
x22 = 1;
x23 = 1;
x24 = 0;
delay_ms(100);

x1 = 1;
x32 = 1;

x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 1;
x22 = 1;
x23 = 0;
delay_ms(100);

x1 = 1;
x32 = 1;
x31 = 1;

x15 = 1;
x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 1;
x22 = 0;
delay_ms(100);

x1 = 1;
x32 = 1;
x31 = 1;
x30 = 1;

x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 0;
delay_ms(100);

x1 = 1;
x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;

x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 0;
delay_ms(100);

x1 = 1;
x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;

x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
x18 = 1;
x19 = 0;
delay_ms(100);

x1 = 1;
x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;

x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
x18 = 0;
delay_ms(100);

x1 = 0;
x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;

x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 0;
delay_ms(100);

x32 = 0;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;

x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 0;
delay_ms(100);

x31 = 0;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;

x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 0;
delay_ms(100);

x30 = 0;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;

x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 0;
delay_ms(100);

x29 = 0;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;

x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 0;
delay_ms(100);

x28 = 0;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;

x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 0;
delay_ms(100);

x27 = 0;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;

x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 0;
delay_ms(100);

x26 = 0;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 1;

x3 = 1;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 0;
delay_ms(100);

x25 = 0;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 1;
x18 = 1;

x2 = 1;
x3 = 1;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 0;
delay_ms(100);

x24 = 0;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 1;
x18 = 1;
x17 = 1;

x1 = 1;
x2 = 1;
x3 = 1;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 0;
delay_ms(100);

//return
x22 = 1;
x24 = 1;
x23 = 1;
x21 = 1;
x20 = 1;
x19 = 1;
x18 = 1;
x17 = 0;

x1 = 0;
x2 = 1;
x3 = 1;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
delay_ms(100);

x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 1;
x18 = 0;

x2 = 0;
x3 = 1;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
delay_ms(100);

x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;

x3 = 0;
x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
delay_ms(100);

x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 0;

x4 = 0;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
delay_ms(100);

x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 0;

x5 = 0;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
delay_ms(100);

x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 0;

x6 = 0;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
delay_ms(100);

x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 0;

x7 = 0;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
delay_ms(100);

}

void seventh_patt(void){                                      // seventh pattern goes here
//// shake pattern

//start of return

x30 = 0;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;

x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 0;
delay_ms(300);

x29 = 0;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;

x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 0;
delay_ms(300);

x28 = 0;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;

x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 0;
delay_ms(300);

x27 = 0;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;

x4 = 1;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 0;
delay_ms(300);   //lowest

// repeat upward

x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 0;

x4 = 0;
x5 = 1;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
delay_ms(300);

x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 1;
x21 = 0;

x5 = 0;
x6 = 1;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
delay_ms(300);

x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 1;
x22 = 0;

x6 = 0;
x7 = 1;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
delay_ms(300);

x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 1;
x23 = 0;

x7 = 0;
x8 = 1;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
delay_ms(300);

}

void eighth_patt(void){                                       // eighth pattern goes here

x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 1;
x24 = 0;

x8 = 0;
x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
delay_ms(100);

x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
x25 = 0;
x24 = 0;

x8 = 0;
x9 = 0;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
delay_ms(100);

x1 = 1;
x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 0;

x10 = 0;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
delay_ms(100);

//start to end

x1 = 1;
x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 0;

x10 = 0;
x11 = 0;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
delay_ms(100);

x1 = 1;
x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 0;
x27 = 0;
x26 = 0;

x10 = 0;
x11 = 0;
x12 = 0;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
delay_ms(100);

x1 = 1;
x32 = 1;
x31 = 1;
x30 = 1;
x29 = 0;
x28 = 0;
x27 = 0;
x26 = 0;

x10 = 0;
x11 = 0;
x12 = 0;
x13 = 0;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
delay_ms(100);

x1 = 1;
x32 = 1;
x31 = 1;
x30 = 0;
x29 = 0;
x28 = 0;
x27 = 0;
x26 = 0;

x10 = 0;
x11 = 0;
x12 = 0;
x13 = 0;
x14 = 0;
x15 = 1;
x16 = 1;
x17 = 1;
delay_ms(100);

x1 = 1;
x32 = 1;
x31 = 0;
x30 = 0;
x29 = 0;
x28 = 0;
x27 = 0;
x26 = 0;

x10 = 0;
x11 = 0;
x12 = 0;
x13 = 0;
x14 = 0;
x15 = 0;
x16 = 1;
x17 = 1;
delay_ms(100);

x1 = 1;
x32 = 0;
x31 = 0;
x30 = 0;
x29 = 0;
x28 = 0;
x27 = 0;
x26 = 0;

x10 = 0;
x11 = 0;
x12 = 0;
x13 = 0;
x14 = 0;
x15 = 0;
x16 = 0;
x17 = 1;
delay_ms(100);

x1 = 1;
x32 = 0;
x16 = 0;
x17 = 1;
delay_ms(100);

x1 = 0;
x32 = 0;
x16 = 0;
x17 = 0;
delay_ms(100);

}

void ninth_patt(void){                                        // ninth pattern goes here
x1 = 1;
delay_ms(100);

x1 = 0;
x32 = 1;
x2 = 1;
delay_ms(100);

x2 = 0;
x32 = 0;
x31 = 1;
x3 = 1;
delay_ms(100);

x3 = 0;
x31 = 0;
x30 = 1;
x4 = 1;
delay_ms(100);

x4 = 0;
x30 = 0;
x29 = 1;
x5 = 1;
delay_ms(100);

x5 = 0;
x29 = 0;
x28 = 1;
x6 = 1;
delay_ms(100);

x6 = 0;
x28= 0;
x27 = 1;
x7 = 1;
delay_ms(100);

x7 = 0;
x27 = 0;
x26 = 1;
x8 = 1;
delay_ms(100);

}

void tenth_patt(void){
x8 = 0;
x26 = 0;
x25 = 1;
x9 = 1;
delay_ms(100);

x9 = 0;
x25 = 0;
x24 = 1;
x10 = 1;
delay_ms(100);

x10 = 0;
x24 = 0;
x23 = 1;
x11 = 1;
delay_ms(100);

x11 = 0;
x23 = 0;
x22 = 1;
x12 = 1;
delay_ms(100);

x12 = 0;
x22 = 0;
x21 = 1;
x13 = 1;
delay_ms(100);

x13 = 0;
x21 = 0;
x20 = 1;
x14 = 1;
delay_ms(100);

x14 = 0;
x20 = 0;
x19 = 1;
x15 = 1;
delay_ms(100);

x15 = 0;
x19 = 0;
x18 = 1;
x16 = 1;
delay_ms(100);

x18 = 0;
x16 = 0;
x17 = 1;
delay_ms(100);
}

void eleventh_patt(){
x8 = 0;
x26 = 0;
x25 = 1;
x9 = 1;
delay_ms(100);

x9 = 0;
x25 = 0;
x24 = 1;
x10 = 1;
delay_ms(100);

x10 = 0;
x24 = 0;
x23 = 1;
x11 = 1;
delay_ms(100);

x11 = 0;
x23 = 0;
x22 = 1;
x12 = 1;
delay_ms(100);

x12 = 0;
x22 = 0;
x21 = 1;
x13 = 1;
delay_ms(100);

x13 = 0;
x21 = 0;
x20 = 1;
x14 = 1;
delay_ms(100);

x14 = 0;
x20 = 0;
x19 = 1;
x15 = 1;
delay_ms(100);

x15 = 0;
x19 = 0;
x18 = 1;
x16 = 1;
delay_ms(100);
}

void twelfth_patt(void){
x8 = 0;
x26 = 0;
x25 = 1;
x9 = 1;
delay_ms(100);

x9 = 0;
x25 = 0;
x24 = 1;
x10 = 1;
delay_ms(100);

x10 = 0;
x24 = 0;
x23 = 1;
x11 = 1;
delay_ms(100);

x11 = 0;
x23 = 0;
x22 = 1;
x12 = 1;
delay_ms(100);

x12 = 0;
x22 = 0;
x21 = 1;
x13 = 1;
delay_ms(100);

x13 = 0;
x21 = 0;
x20 = 1;
x14 = 1;
delay_ms(100);

x14 = 0;
x20 = 0;
x19 = 1;
x15 = 1;
delay_ms(100);
}

void thirteenth_path(void){

x8 = 0;
x26 = 0;
x25 = 1;
x9 = 1;
delay_ms(100);

x9 = 0;
x25 = 0;
x24 = 1;
x10 = 1;
delay_ms(100);

x10 = 0;
x24 = 0;
x23 = 1;
x11 = 1;
delay_ms(100);

x11 = 0;
x23 = 0;
x22 = 1;
x12 = 1;
delay_ms(100);

x12 = 0;
x22 = 0;
x21 = 1;
x13 = 1;
delay_ms(100);

x13 = 0;
x21 = 0;
x20 = 1;
x14 = 1;
delay_ms(100);

}

void fourteenth_patt(void){

x8 = 0;
x26 = 0;
x25 = 1;
x9 = 1;
delay_ms(100);

x9 = 0;
x25 = 0;
x24 = 1;
x10 = 1;
delay_ms(100);

x10 = 0;
x24 = 0;
x23 = 1;
x11 = 1;
delay_ms(100);

x11 = 0;
x23 = 0;
x22 = 1;
x12 = 1;
delay_ms(100);

x12 = 0;
x22 = 0;
x21 = 1;
x13 = 1;
delay_ms(100);
}

void fifteenth_patt(void){

x8 = 0;
x26 = 0;
x25 = 1;
x9 = 1;
delay_ms(100);

x9 = 0;
x25 = 0;
x24 = 1;
x10 = 1;
delay_ms(100);

x10 = 0;
x24 = 0;
x23 = 1;
x11 = 1;
delay_ms(100);

x11 = 0;
x23 = 0;
x22 = 1;
x12 = 1;
delay_ms(100);

}

void sixteenth_patt(void){

x8 = 0;
x26 = 0;
x25 = 1;
x9 = 1;
delay_ms(100);

x9 = 0;
x25 = 0;
x24 = 1;
x10 = 1;
delay_ms(100);

x10 = 0;
x24 = 0;
x23 = 1;
x11 = 1;
delay_ms(100);

}

void seventeenth_patt(void){

x8 = 0;
x26 = 0;
x25 = 1;
x9 = 1;
delay_ms(100);

x9 = 0;
x25 = 0;
x24 = 1;
x10 = 1;
delay_ms(100);

}

void eighteenth_patt(void){

x8 = 0;
x26 = 0;
x25 = 1;
x9 = 1;
delay_ms(100);

}

void ninteenth_patt(void){

x9 = 1;
x10 = 1;
x11 = 1;
x12 = 1;
x13 = 1;
x14 = 1;
x15 = 1;
x16 = 1;
x17 = 1;
x18 = 1;
x19 = 1;
x20 = 1;
x21 = 1;
x22 = 1;
x23 = 1;
x24 = 1;
x25 = 1;
}

void twentieth_patt(void){

x9 = 0;
x10 = 0;
x11 = 0;
x12 = 0;
x13 = 0;
x14 = 0;
x15 = 0;
x16 = 0;
x17 = 0;
x18 = 0;
x19 = 0;
x20 = 0;
x21 = 0;
x22 = 0;
x23 = 0;
x24 = 0;
x25 = 0;
}

void twenty1_patt(void){

x8 = 1;
x7 = 1;
x6 = 1;
x5 = 1;
x4 = 1;
x3 = 1;
x2 = 1;
x1 = 1;
x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 1;
}

void twenty2_patt(void){

x8 = 0;
x7 = 0;
x6 = 0;
x5 = 0;
x4 = 0;
x3 = 0;
x2 = 0;
x1 = 0;
x32 = 0;
x31 = 0;
x30 = 0;
x29 = 0;
x28 = 0;
x27 = 0;
x26 = 0;
}

void twenty3_patt(void){
x1 = 1;
x2 = 0;
x3 = 1;
x4 = 0;
x5 = 1;
x6 = 0;
x7 = 1;
x8 = 0;
x9 = 1;
x10 = 0;
x11 = 1;
x12 = 0;
x13 = 1;
x14 = 0;
x15 = 1;
x16 = 0;
x17 = 1;
x18 = 0;
x19 = 1;
x20 = 0;
x21 = 1;
x22 = 0;
x23 = 1;
x24 = 0;
x25 = 1;
x26 = 0;
x27 = 1;
x28 = 0;
x29 = 1;
x30 = 0;
x31 = 1;
x32 = 0;
}

void twenty4_patt(void){              //moving heart
x1 = 0;
x2 = 1;
x3 = 0;
x4 = 1;
x5 = 0;
x6 = 1;
x7 = 0;
x8 = 1;
x9 = 0;
x10 = 1;
x11 = 0;
x12 = 1;
x13 = 0;
x14 = 1;
x15 = 0;
x16 = 1;
x17 = 0;
x18 = 1;
x19 = 0;
x20 = 1;
x21 = 0;
x22 = 1;
x23 = 0;
x24 = 1;
x25 = 0;
x26 = 1;
x27 = 0;
x28 = 1;
x29 = 0;
x30 = 1;
x31 = 0;
x32 = 1;
}

void twenty5_patt(void){         // passing pattern     a

x6 = 1;
x5 = 1;
x4 = 1;
x3 = 1;

x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;

x22 = 1;
x21 = 1;
x20 = 1;
x19 = 1;

x14 = 1;
x13 = 1;
x12 = 1;
x11 = 1;
delay_ms(500);

// passing pattern  b

x6 = 1;
x5 = 1;
x4 = 1;
x3 = 0;
x2 = 1;

x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 1;

x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;
x18 = 1;

x14 = 1;
x13 = 1;
x12 = 1;
x11 = 0;
x10 = 1;
delay_ms(500);

// passing pattern   c

x6 = 1;
x5 = 1;
x4 = 1;
x3 = 0;
x2 = 0;
x1 = 1;

x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 0;
x25 = 1;

x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;
x18 = 0;
x17 = 1;

x14 = 1;
x13 = 1;
x12 = 1;
x11 = 0;
x10 = 0;
x9 = 1;
delay_ms(500);

// passing pattern  d

x6 = 1;
x5 = 1;
x4 = 1;
x3 = 0;
x2 = 0;
x1 = 0;
x32 = 1;

x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 0;
x25 = 0;
x24 = 1;

x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;
x18 = 0;
x17 = 0;
x16 = 1;

x14 = 1;
x13 = 1;
x12 = 1;
x11 = 0;
x10 = 0;
x9 = 0;
x8 = 1;
delay_ms(500);

// passing pattern     e

x6 = 1;
x5 = 1;
x4 = 1;
x3 = 1;
x2 = 0;
x1 = 0;
x32 = 0;
x31 = 1;

x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 0;
x25 = 0;
x24 = 0;
x23 = 1;

x22 = 1;
x21 = 1;
x20 = 1;
x19 = 1;
x18 = 0;
x17 = 0;
x16 = 0;
x15 = 1;

x14 = 1;
x13 = 1;
x12 = 1;
x11 = 1;
x10 = 0;
x9 = 0;
x8 = 0;
x7 = 1;
delay_ms(500);
}

void twenty6_patt(void){

// passing pattern     a

x7 = 1;
x6 = 1;
x5 = 1;
x4 = 1;
x3 = 0;
x2 = 1;
x1 = 0;

x32 = 0;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 1;

x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;
x18 = 1;

x15 = 1;
x14 = 1;
x13 = 1;
x12 = 1;
x11 = 0;
x10 = 1;

delay_ms(500);

// passing pattern  b
x7 = 1;
x6 = 1;
x5 = 1;
x4 = 1;
x3 = 0;
x2 = 0;
x1 = 1;

x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 0;
x25 = 1;

x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;
x18 = 0;
x17 = 1;

x15 = 1;
x14 = 1;
x13 = 1;
x12 = 1;
x11 = 0;
x10 = 0;
x9 = 1;
delay_ms(500);

// passing pattern  c

x7 = 1;
x6 = 1;
x5 = 1;
x4 = 1;
x3 = 0;
x2 = 0;
x1 = 0;
x32 = 1;

x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 0;
x25 = 0;
x24 = 1;

x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;
x18 = 0;
x17 = 0;
x16 = 1;

x15 = 1;
x14 = 1;
x13 = 1;
x12 = 1;
x11 = 0;
x10 = 0;
x9 = 0;
x8 = 1;

x3 = 1;
x11 = 1;
x19 = 1;
x27 = 1;
delay_ms(500);

}

void twenty7_patt(void){

//pattern a

x8 = 1;
x7 = 1;
x6 = 1;
x5 = 1;
x4 = 1;
x3 = 0;
x2 = 1;

x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 1;

x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;
x18 = 1;

x16 = 1;
x15 = 1;
x14 = 1;
x13 = 1;
x12 = 1;
x11 = 0;
x10 = 1;
delay_ms(500);

//pattern b

x8 = 1;
x7 = 1;
x6 = 1;
x5 = 1;
x4 = 1;
x3 = 0;
x2 = 0;
x1 = 1;

x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 0;
x25 = 1;

x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;
x18 = 0;
x17 = 1;

x16 = 1;
x15 = 1;
x14 = 1;
x13 = 1;
x12 = 1;
x11 = 0;
x10 = 0;
x9 = 1;
delay_ms(500);

}

void twenty8_patt(void){

//pattern a
x8 = 1;
x7 = 1;
x6 = 1;
x5 = 1;
x4 = 1;
x3 = 0;
x2 = 1;
x1 = 0;

x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 1;
x25 = 0;

x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;
x18 = 1;
x17 = 0;

x16 = 1;
x15 = 1;
x14 = 1;
x13 = 1;
x12 = 1;
x11 = 0;
x10 = 1;
x9 = 0;
delay_ms(500);

x8 = 1;
x7 = 1;
x6 = 1;
x5 = 1;
x4 = 1;
x3 = 1;
x2 = 0;
x1 = 1;

x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 1;
x26 = 0;
x25 = 1;

x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 1;
x18 = 0;
x17 = 1;

x16 = 1;
x15 = 1;
x14 = 1;
x13 = 1;
x12 = 1;
x11 = 1;
x10 = 0;
x9 = 1;
delay_ms(500);

}

void twenty9_patt(void){

x7 = 1;
x6 = 1;
x5 = 1;
x4 = 1;
x3 = 0;
x2 = 1;
x1 = 1;

x32 = 1;
x31 = 1;
x30 = 1;
x29 = 1;
x28 = 1;
x27 = 0;
x26 = 1;
x25 = 1;

x24 = 1;
x23 = 1;
x22 = 1;
x21 = 1;
x20 = 1;
x19 = 0;
x18 = 1;
x17 = 1;

x16 = 1;
x15 = 1;
x14 = 1;
x13 = 1;
x12 = 1;
x11 = 0;
x10 = 1;
x9 = 1;
delay_ms(500);

}

void t30_patt(void){

second_patta();
x17 = 0;
delay_ms(100);

second_patta();
x16 = 0;
delay_ms(100);

second_patta();
x15 = 0;
delay_ms(100);

second_patta();
x14 = 0;
delay_ms(100);

second_patta();
x13 = 0;
delay_ms(100);

second_patta();
x12 = 0;
delay_ms(100);

second_patta();
x11 = 0;
delay_ms(100);

second_patta();
x10 = 0;
delay_ms(100);

second_patta();
x9 = 0;
delay_ms(100);

second_patta();
x8 = 0;
delay_ms(100);

second_patta();
x7 = 0;
delay_ms(100);

second_patta();
x6 = 0;
delay_ms(100);

second_patta();
x5 = 0;
delay_ms(100);

second_patta();
x4 = 0;
delay_ms(100);

second_patta();
x3 = 0;
delay_ms(100);

second_patta();
x2 = 0;
delay_ms(100);

second_patta();
x1 = 0;
delay_ms(100);

second_patta();
x32 = 0;
delay_ms(100);

second_patta();
x31 = 0;
delay_ms(90);

second_patta();
x30 = 0;
delay_ms(80);

second_patta();
x29 = 0;
delay_ms(80);

second_patta();
x28 = 0;
delay_ms(80);

second_patta();
x27 = 0;
delay_ms(70);

second_patta();
x26 = 0;
delay_ms(70);

second_patta();
x25 = 0;
delay_ms(60);

second_patta();
x24 = 0;
delay_ms(60);

second_patta();
x23 = 0;
delay_ms(60);

second_patta();
x22 = 0;
delay_ms(55);

second_patta();
x21 = 0;
delay_ms(55);

second_patta();
x20 = 0;
delay_ms(50);

second_patta();
x19 = 0;
delay_ms(50);

second_patta();
x18 = 0;
delay_ms(50);

second_patta();
x17 = 0;
delay_ms(50);

second_patta();
delay_ms(50);

///////////////// copy
}

void t31_patt(void){

x25 = 1;
delay_ms(150);

x25 = 0;
x24 = 1;
x26 = 1;
delay_ms(150);

x25 = 1;
x24 = 0;
x26 = 0;
x27 = 1;
x23 = 1;
delay_ms(150);

x25 = 0;
x24 = 1;
x26 = 1;
x27 = 0;
x23 = 0;
x22 = 1;
x28 = 1;
delay_ms(150);

x25 = 1;
x24 = 0;
x26 = 0;
x27 = 1;
x23 = 1;
x22 = 0;
x28 = 0;
x21 = 1;
x29 = 1;
delay_ms(150);

x25 = 0;
x24 = 1;
x26 = 1;
x27 = 0;
x23 = 0;
x22 = 1;
x28 = 1;
x21 = 0;
x29 = 0;
x30 = 1;
x20 = 1;
delay_ms(150);

x25 = 1;
x24 = 0;
x26 = 0;
x27 = 1;
x23 = 1;
x22 = 0;
x28 = 0;
x21 = 1;
x29 = 1;
x30 = 0;
x20 = 0;
x31 = 1;
x19 = 1;
delay_ms(150);

x25 = 0;
x24 = 1;
x26 = 1;
x27 = 0;
x23 = 0;
x22 = 1;
x28 = 1;
x21 = 0;
x29 = 0;
x30 = 1;
x20 = 1;
x31 = 0;
x19 = 0;
x18 = 1;
x32 = 1;
delay_ms(150);

x25 = 1;
x24 = 0;
x26 = 0;
x27 = 1;
x23 = 1;
x22 = 0;
x28 = 0;
x21 = 1;
x29 = 1;
x30 = 0;
x20 = 0;
x31 = 1;
x19 = 1;
x18 = 0;
x32 = 0;
x1 = 1;
x17 = 1;
delay_ms(150);

x25 = 0;
x24 = 1;
x26 = 1;
x27 = 0;
x23 = 0;
x22 = 1;
x28 = 1;
x21 = 0;
x29 = 0;
x30 = 1;
x20 = 1;
x31 = 0;
x19 = 0;
x18 = 1;
x32 = 1;
x1 = 0;
x17 = 0;
x16 = 1;
x2 = 1;
delay_ms(150);

x25 = 1;
x24 = 0;
x26 = 0;
x27 = 1;
x23 = 1;
x22 = 0;
x28 = 0;
x21 = 1;
x29 = 1;
x30 = 0;
x20 = 0;
x31 = 1;
x19 = 1;
x18 = 0;
x32 = 0;
x1 = 1;
x17 = 1;
x16 = 0;
x2 = 0;
x3 = 1;
x15 = 1;
delay_ms(150);

x25 = 0;
x24 = 1;
x26 = 1;
x27 = 0;
x23 = 0;
x22 = 1;
x28 = 1;
x21 = 0;
x29 = 0;
x30 = 1;
x20 = 1;
x31 = 0;
x19 = 0;
x18 = 1;
x32 = 1;
x1 = 0;
x17 = 0;
x16 = 1;
x2 = 1;
x3 = 0;
x15 = 0;
x14 = 1;
x4 = 1;
delay_ms(150);

x25 = 1;
x24 = 0;
x26 = 0;
x27 = 1;
x23 = 1;
x22 = 0;
x28 = 0;
x21 = 1;
x29 = 1;
x30 = 0;
x20 = 0;
x31 = 1;
x19 = 1;
x18 = 0;
x32 = 0;
x1 = 1;
x17 = 1;
x16 = 0;
x2 = 0;
x3 = 1;
x15 = 1;
x14 = 0;
x4 = 0;
x5 = 1;
x13 = 1;
delay_ms(150);

x25 = 0;
x24 = 1;
x26 = 1;
x27 = 0;
x23 = 0;
x22 = 1;
x28 = 1;
x21 = 0;
x29 = 0;
x30 = 1;
x20 = 1;
x31 = 0;
x19 = 0;
x18 = 1;
x32 = 1;
x1 = 0;
x17 = 0;
x16 = 1;
x2 = 1;
x3 = 0;
x15 = 0;
x14 = 1;
x4 = 1;
x5 = 0;
x13 = 0;
x12 = 1;
x6 = 1;
delay_ms(150);

x25 = 1;
x24 = 0;
x26 = 0;
x27 = 1;
x23 = 1;
x22 = 0;
x28 = 0;
x21 = 1;
x29 = 1;
x30 = 0;
x20 = 0;
x31 = 1;
x19 = 1;
x18 = 0;
x32 = 0;
x1 = 1;
x17 = 1;
x16 = 0;
x2 = 0;
x3 = 1;
x15 = 1;
x14 = 0;
x4 = 0;
x5 = 1;
x13 = 1;
x12 = 0;
x6 = 0;
x7 = 1;
x11 = 1;
delay_ms(150);

x25 = 0;
x24 = 1;
x26 = 1;
x27 = 0;
x23 = 0;
x22 = 1;
x28 = 1;
x21 = 0;
x29 = 0;
x30 = 1;
x20 = 1;
x31 = 0;
x19 = 0;
x18 = 1;
x32 = 1;
x1 = 0;
x17 = 0;
x16 = 1;
x2 = 1;
x3 = 0;
x15 = 0;
x14 = 1;
x4 = 1;
x5 = 0;
x13 = 0;
x12 = 1;
x6 = 1;
x7 = 0;
x11 = 0;
x8 = 1;
x10 = 1;
delay_ms(150);

x25 = 1;
x24 = 0;
x26 = 0;
x27 = 1;
x23 = 1;
x22 = 0;
x28 = 0;
x21 = 1;
x29 = 1;
x30 = 0;
x20 = 0;
x31 = 1;
x19 = 1;
x18 = 0;
x32 = 0;
x1 = 1;
x17 = 1;
x16 = 0;
x2 = 0;
x3 = 1;
x15 = 1;
x14 = 0;
x4 = 0;
x5 = 1;
x13 = 1;
x12 = 0;
x6 = 0;
x7 = 1;
x11 = 1;
x8 = 0;
x10 = 0;
x9 = 1;
delay_ms(150);

}

void t32_patta(void){
second_patta();
x13 = 0;
x12 = 0;
x11 = 0;
x10 = 0;
x5 = 0;
x4 = 0;
x3 = 0;
x2 = 0;
x29 = 0;
x28 = 0;
x27 = 0;
x26 = 0;
x21 = 0;
x20 = 0;
x19 = 0;
x18 = 0;
}

void t32_pattb(void){
second_patta();
x12 = 0;
x11 = 0;
x10 = 0;
x4 = 0;
x3 = 0;
x2 = 0;
x28 = 0;
x27 = 0;
x26 = 0;
x20 = 0;
x19 = 0;
x18 = 0;
}

void t32_pattc(void){
second_patta();
x11 = 0;
x10 = 0;
x3 = 0;
x2 = 0;
x27 = 0;
x26 = 0;
x19 = 0;
x18 = 0;
}

void t32_pattd(void){
second_patta();
x10 = 0;
x2 = 0;
x26 = 0;
x18 = 0;
}

void t33_patta(void){

second_patta();
x17 = 0;
x16 = 0;
x15 = 0;
x14 = 0;
x9 = 0;
x8 = 0;
x7 = 0;
x6 = 0;
x1 = 0;
x32 = 0;
x31 = 0;
x30 = 0;
x25 = 0;
x24 = 0;
x23 = 0;
x22 = 0;
}

void t33_pattb(void){
second_patta();
x17 = 0;
x16 = 0;
x15 = 0;
x9 = 0;
x8 = 0;
x7 = 0;
x1 = 0;
x32 = 0;
x31 = 0;
x25 = 0;
x24 = 0;
x23 = 0;
}

void t33_pattc(void){

second_patta();
x17 = 0;
x16 = 0;
x9 = 0;
x8 = 0;
x1 = 0;
x32 = 0;
x25 = 0;
x24 = 0;

}

void t33_pattd(void){

second_patta();
x17 = 0;
x9 = 0;
x1 = 0;
x25 = 0;
}

void main() {
init_all();
delay_us(1000);

while(1){
very_first();

first_patta();   /// 1st pattern
first_pattb();
second_patta();  /// 2nd pattern
delay_ms(800);
second_pattb();  /// 2nd pattern
delay_ms(800);

second_patta();  /// 2nd pattern
delay_ms(600);
second_pattb();  /// 2nd pattern
delay_ms(900);

third_patt();   /// 3rd pattern
fourth_patt();  /// 4th pattern
fifth_patt();   /// 5th pattern
sixth_patt();   /// 6th pattern
seventh_patt(); /// 7th pattern
seventh_patt(); /// 7th pattern
seventh_patt(); /// 7th pattern
eighth_patt(); /// 8th pattern
ninth_patt();   /// 9th pattern
tenth_patt();   /// 10th pattern
ninth_patt();
eleventh_patt();
ninth_patt();
twelfth_patt();
ninth_patt();
thirteenth_path();
ninth_patt();
fourteenth_patt();
ninth_patt();
fifteenth_patt();
ninth_patt();
sixteenth_patt();
ninth_patt();
seventeenth_patt();
ninth_patt();
eighteenth_patt();
//separate delays
ninteenth_patt();
delay_ms(100);
twentieth_patt();
delay_ms(300);

ninteenth_patt();
delay_ms(200);
twentieth_patt();
delay_ms(500);

ninteenth_patt();
delay_ms(200);
twentieth_patt();
delay_ms(700);

ninteenth_patt();
delay_ms(300);
twentieth_patt();
delay_ms(800);

twenty1_patt();
delay_ms(500);
twenty2_patt();
delay_ms(600);

twenty1_patt();
delay_ms(700);
twenty2_patt();
delay_ms(300);

twenty1_patt();
delay_ms(900);
twenty2_patt();
delay_ms(100);

second_patta();
delay_ms(800);
second_pattb();
delay_ms(800);

second_patta();
delay_ms(200);
second_pattb();
delay_ms(200);

second_patta();
delay_ms(800);
second_pattb();
delay_ms(800);

second_patta();
delay_ms(800);

twenty3_patt();
delay_ms(1000);
twenty4_patt();
delay_ms(800);

twenty3_patt();
delay_ms(800);
twenty4_patt();
delay_ms(1000);

twenty3_patt();
delay_ms(500);
twenty4_patt();
delay_ms(600);

twenty3_patt();
delay_ms(300);
twenty4_patt();
delay_ms(400);

twenty3_patt();
delay_ms(500);
twenty4_patt();
delay_ms(400);

twenty3_patt();
delay_ms(400);
twenty4_patt();
delay_ms(700);

second_patta();
delay_ms(500);
second_pattb();
delay_ms(700);

second_patta();
delay_ms(300);

twenty5_patt();
twenty6_patt();
twenty8_patt();
twenty9_patt();
second_patta();
delay_ms(500);

t30_patt();      //1 off led going around

first_pattb();

t31_patt();

twenty4_patt();
delay_ms(400);
twenty3_patt();                     //alternating
delay_ms(400);

twenty4_patt();
delay_ms(400);
twenty3_patt();                     //alternating
delay_ms(400);

twenty4_patt();
delay_ms(400);
twenty3_patt();                     //alternating
delay_ms(400);

second_pattb();
delay_ms(500);

t32_patta();                      //counter clockwise 4 set
delay_ms(400);
t32_pattb();
delay_ms(400);
t32_pattc();
delay_ms(400);
t32_pattd();
delay_ms(400);
second_patta();
delay_ms(300);

t33_patta();                      //clockwise 4 set
delay_ms(400);
t33_pattb();
delay_ms(400);
t33_pattc();
delay_ms(400);
t33_pattd();
delay_ms(400);
second_pattb();
delay_ms(300);
}
}

View the demo video here:

Watch it on FACEBOOK

Advertisements

11 responses to “Heart-Shaped LEDs

    • Hi Edvinas, the project is supposed to be used exclusively for Mikroc Pro for PIC compiler. You’ll definitely encounter errors if you use this one with other compilers since they have their own syntax.

  1. Can I have the complete component list and the pcb layout ?
    By the way , is that MPLAB can use for the coding
    above ? …. Ur help r very much appreciated 😄

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s