ajay Profile Topics Started Replies Created Engagements Search replies: Forum Replies Created Viewing 1 post (of 1 total) Author Posts June 8, 2013 at 4:24 am in reply to: Bipolar Stepper Motor 8051 C-program is needed!!! Please share if anybody have one. #9905 ajayParticipant #include<reg51.h>sbit ir=P2^0;sbit buzzer=P0^7;stepper();delay(unsigned int);unsigned char i;unsigned int z,s;main(){buzzer=0;while(1){if(ir==0){buzzer=1;stepper();buzzer=0;}else{buzzer=0;}}}stepper(){for(s=0;s<14;s++){for(z=0x01;z<0x0a;z=z*2){P3=z;delay(5);}}for(s=0;s<14;s++){for(z=0x08;z>0x00;z=z/2){P3=z;delay(5);}}}delay(unsigned int time){unsigned int i,j;for(i=0;i<time;i++)for(j=0;j<1275;j++);} Author Posts Viewing 1 post (of 1 total)