i have written code for my servo motor which is HITECH HS-442..using atmega16..but with this code it is taking only 12 positions..i need to control the angles..what shud i do with this code??.
Rich (BB code):
#include<avr/io.h>
#include<util/delay.h>
float num1=0.1;
int main()
{
DDRB=0xFF;
PORTB=0x00;
int i;
while(1)
{
for(i=1;i<=10;i++)
{
PORTB=(1<<0);
_delay_ms(num1);
PORTB=0x00;
_delay_ms(20);
num1=num1+.5;
_delay_ms(1000);
}
}
}
Last edited by a moderator: