Buy an Axon, Axon II, or Axon Mote and build a great robot, while helping to support SoR.
0 Members and 1 Guest are viewing this topic.
myArray[i]
i know 1.5 ms will make the servo turn 90degrees and 2ms upto 180 degree
while(1){ for(i=0;i++;i<50) / to keep the signal for 1 second {PORTD.7 =1; delay_ms(1); /go to angle 0 PORTD.7=0; delay_ms(20);} for(i=0;i++;i<50) {PORTD.7 =1; delay_ms(2); /go to angle 180 PORTD.7=0; delay_ms(20);}}
suppose the servo is at 120 degree angle and i give a delay of 1.5 ms pwm so it will automatically go to 90 degree no matter what may be the position of the servo initially
i think delay ms is not a good option i will rely on the hardware timer
WHAT ABOUT THE ERROR OF THE OSCILATOR IN THE MCU ITSELF, OR IS THAT NOT SIGNIFICANT ENOUGH TO MATTER?
well what iam saying is if i write delay_ms(5) then what is delayed and how much it is delayed??
well then i have been doing it the correct way now another dbt is it_delay_msor delay_ms