/******************************************************************** * Utripa led.C * *-------------------------------------------------------------------* * programiral:Slavko Murko * * prevedeno z (PICC - CCS PCM verz.2.542) * *********************************************************************/ #case // Da loči male in velike črke #ZERO_RAM // Briše RAM po startu programa /***********************************/ #include <16f628a.h> #USE DELAY (CLOCK=4000000) #fuses XT,NOWDT,PUT,NOPROTECT,NOLVP void main() { int program; while (1) { if(!input(PIN_A2)) program++; if (program>5) program=0; if(program==0) { //prižiganje output_high(PIN_B0);// output_high(PIN_B7);// delay_ms(200); output_high(PIN_B1);// output_high(PIN_B6);// delay_ms(200); output_high(PIN_B3);// output_high(PIN_B4);// delay_ms(200); output_high(PIN_B5);// delay_ms(200); output_high(PIN_B2);// delay_ms(200); //ugašanje output_low(PIN_B2);// delay_ms(200); output_low(PIN_B5);// delay_ms(200); output_low(PIN_B3);// output_low(PIN_B4);// delay_ms(200); output_low(PIN_B1);// output_low(PIN_B6);// delay_ms(200); output_low(PIN_B0);// output_low(PIN_B7);// delay_ms(200); } if(program==1) { output_b(0b00000000);// output_high(PIN_B0);// delay_ms(200); output_high(PIN_B1);// delay_ms(200); output_high(PIN_B4);// delay_ms(200); output_high(PIN_B5);// delay_ms(200); output_high(PIN_B2);// delay_ms(200); output_high(PIN_B5);// delay_ms(200); output_high(PIN_B3);// delay_ms(200); output_high(PIN_B6);// delay_ms(200); output_high(PIN_B7);// delay_ms(200); output_b(0b00000000);// delay_ms(200); } if(program==2) { output_b(0b00000000);// output_high(PIN_B7);// delay_ms(200); output_high(PIN_B6);// delay_ms(200); output_high(PIN_B3);// delay_ms(200); output_high(PIN_B5);// delay_ms(200); output_high(PIN_B2);// delay_ms(200); output_high(PIN_B5);// delay_ms(200); output_high(PIN_B4);// delay_ms(200); output_high(PIN_B1);// delay_ms(200); output_high(PIN_B0);// delay_ms(200); output_b(0b00000000);// delay_ms(200); } if(program==3) { output_b(0b00000000);// output_high(PIN_B0);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B1);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B4);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B5);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B2);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B5);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B3);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B6);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B7);// delay_ms(200); output_b(0b00000000);// } if(program==4) { output_b(0b00000000);// output_high(PIN_B7);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B6);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B3);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B5);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B2);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B5);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B4);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B1);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B0);// delay_ms(200); output_b(0b00000000);// } if(program==5) { output_b(0b00000000);// output_high(PIN_B0);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B1);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B4);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B5);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B2);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B5);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B3);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B6);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B7);// delay_ms(200); output_b(0b00000000);// output_b(0b00000000);// output_high(PIN_B7);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B6);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B3);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B5);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B2);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B5);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B4);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B1);// delay_ms(200); output_b(0b00000000);// output_high(PIN_B0);// delay_ms(200); output_b(0b00000000);// } } // konec while 1 } // konec main