/*
* SERVOS_EXECUTION.c
*
* Created: 25-Nov-13 11:37:32
* Author: avrnarm
*/
#define F_CPU 16000000ul
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRC=0xFF;
DDRD=0xFF;
char i ;
while(1)
{
_delay_ms(2000);
for (i=0;i<2;i++)
{
PORTC=0xFF;
PORTD=0xFF;
_delay_us(1000+5.55*10) ;
PORTC=0x00;
PORTD=0x00;
_delay_us(2010) ;
}
_delay_ms(2000);
for (i=0;i<2;i++)
{
PORTC=0xFF;
PORTD=0xFF;
_delay_us(1000+5.55*50) ;
PORTC=0x00;
PORTD=0x00;
_delay_us(2010) ;
}
_delay_ms(2000);
for (i=0;i<2;i++)
{
PORTC=0xFF;
PORTD=0xFF;
_delay_us(1000+5.55*60) ;
PORTC=0x00;
PORTD=0x00;
_delay_us(2010) ;
}
}
* SERVOS_EXECUTION.c
*
* Created: 25-Nov-13 11:37:32
* Author: avrnarm
*/
#define F_CPU 16000000ul
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRC=0xFF;
DDRD=0xFF;
char i ;
while(1)
{
_delay_ms(2000);
for (i=0;i<2;i++)
{
PORTC=0xFF;
PORTD=0xFF;
_delay_us(1000+5.55*10) ;
PORTC=0x00;
PORTD=0x00;
_delay_us(2010) ;
}
_delay_ms(2000);
for (i=0;i<2;i++)
{
PORTC=0xFF;
PORTD=0xFF;
_delay_us(1000+5.55*50) ;
PORTC=0x00;
PORTD=0x00;
_delay_us(2010) ;
}
_delay_ms(2000);
for (i=0;i<2;i++)
{
PORTC=0xFF;
PORTD=0xFF;
_delay_us(1000+5.55*60) ;
PORTC=0x00;
PORTD=0x00;
_delay_us(2010) ;
}
}
0 comments:
Post a Comment