Robot_2010.c
PORTA=active;
_delay_us(100);
if(PINB & dir_mask)
return;
do
{
PORTA&=rest;
_delay_us(300);
PORTA|=0b01000100;
_delay_us(1800);
// 1800 = max isolle moottorille, 950
menee vielä pienelle moottorille...
if(steps < 255) steps--;
}
while(steps && !(PINB & dir_mask) );
}
// this function checks wether the given string ref can be found
// at given position on string data
//
// - TKH 2008
char StrCompare(const char *ref, unsigned char *data)
{
do
{
if(*ref != *data) return 0;
ref++;
data++;
}
while(*ref);
return 1;
}
Sivu 3