pratti
Member level 3
- Joined
- Jun 15, 2013
- Messages
- 56
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Activity points
- 471
my steper motor doesnot rotate 180 in protius.in protius it just stopt at -2.42.why is it so?my code is as below
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 #include<reg52.h> #include<stdio.h> void T0delay(int); void main() { int count; count=0; do { for(count=0;count<=48;count++) { P2=0x06; //0001 T0delay(100); P2=0x03; //0100 T0delay(100); P2=0x09; //0010 T0delay(100); P2=0x0C; //1000 T0delay(100); } }while(1); } //void T0delay(int k) //{ // int i,j; // for(i=0;i<1275;i++) //{ // for(j=0;j<k;j++) // { // } //} //} void T0Delay() //delay by using timer { TMOD=0x01; // timer 0, mode 1 TL0=0x35; // load TL0 TH0=0x00; // load TH0 TR0=1; // turn on Timer0 while (TF0==0); // wait for TF0 to roll over TR0=0; // turn off timer TF0=0; // clear TF0 }
Last edited by a moderator: