Example #1
0
int step(){
	int result = 1;
	if (!(DRILLSTATUS & 0x02))
	{
		alarm(3);
		result = 0;
	} else
	{
		Outone(0);
		Outone(1);
		hold((time_type)500);
		Outzero(1);//do i need this
		Outzero(0);//do i need this
    }	
    return result;
}
Example #2
0
void alarm( int amount ){
	while(amount){
		Outone(4);
		delay(500);
		Outzero(4);
		--amount;
		if(amount){
			delay(250);
		}
	}

}
Example #3
0
//vrider borren 1 steg
int step(void){
	if(ML4IN &(2)){
		//är i toppläge
		Outone(1);
		Outone(0);
		hold((time_type)250);
		Outzero(0);
		hold((time_type)500);
		return 1; 
	}
	Alarm(2);
	return 0;
}
Example #4
0
void Alarm(int amount){
	int i;
	for(i = 0; i < amount;i++){
		Outone(4);
		hold(1000);
		Outzero(4);
		if(!(i == amount - 1)){
			//skippa sista iterationen av delay
			hold(500);
		}
	}

}
Example #5
0
void DrillUp(void)
{
	Outzero(3);
}
Example #6
0
void MotorStop(void)
{
	Outzero(2);
//	delay(1000);
}
Example #7
0
void DrillUp(void){
	Outzero(3);
	hold((time_type)250);
}
Example #8
0
void MotorStop(void){
	Outzero(2);
}