ather_88
Newbie level 5
- Joined
- May 22, 2014
- Messages
- 10
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 90
I have written a code for controlling servo motor using CCS compiler, for the rotation of the motor from its neutral position to its clock wise direction in 15 degrees interval, the code is tested on Proteus its working fine but as I burnt the controller, the motor does not moves in the same way.
the code is as follows:
Kindly someone help me in changing the code where I have make a mistake.
the code is as follows:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #include<16f877a.h> #fuses HS,NOLVP #use delay(clock=20000000) void main() { int16 i; while(1) { for(i=1500;i<=2000;) { output_high(PIN_B7); output_high(PIN_D6); delay_us(i); //sending 5 volts to servo for pulse_width microseconds output_low(PIN_D6); delay_ms(20); delay_ms(300); i = i+82; } } }
Kindly someone help me in changing the code where I have make a mistake.
Last edited by a moderator: