//---------------------------------------------------------------------------------------// // This program flashes led's attached to Port.0 // //This code is written by Mubashar Yasin(Islamabad,Pakistan).It is freely distributable // //however please distribute it with my name and if you add this code to your website or // //some other publication then mention about me along with this code.I have tested this // //code to work properly even then there is no guarantee or warranty and i cannot be held // //responsible for any damage or loss due to this code.If you have any querries about this// //code please contact me at: // // // // kool_projects@yahoo.com // // mubasharpk09@hotmail.com // // // //or visit my website: // // // // http://www.geocities.com/kool_projects // //---------------------------------------------------------------------------------------// #include void delay(void) { unsigned int x; for(x=0;x<10000;x++){} } main() { unsigned int k; unsigned char j; while (1) { for(k=0;k<10;k++)//starting sequence { P0=0xFF; delay(); delay(); P0=0x00; delay(); delay(); }//end starting sequence for(k=0;k<15;k++)//first sequence { for (j=0x01; j< 0x80; j<<=1) { P0 = j; delay(); }//end for for (j=0x80; j> 0x01; j>>=1) { P0 = j; delay(); }//end for }//end first sequence for(k=0;k<15;k++)//second sequence { P0=0x0F; delay(); delay(); P0=0xF0; delay(); delay(); }//end second sequence for(k=0;k<15;k++)//third sequence { P0=0xAA; delay(); delay(); P0=0x55; delay(); delay(); }//end third sequence }//end while }//end main