Beispiel #1
0
// Subclasses can override
void step(Stepper_t* motor, long step)
{
    switch (motor->_interface)
    {
        case FUNCTION:
            step0(motor, step);
            break;

		case DRIVER:
			step1(motor, step);
			break;

		case FULL2WIRE:
			step2(motor, step);
			break;

		case FULL3WIRE:
			step3(motor, step);
			break;

		case FULL4WIRE:
			step4(motor, step);
			break;

		case HALF3WIRE:
			step6(motor, step);
			break;

		case HALF4WIRE:
			step8(motor, step);
			break;
    }
}
Beispiel #2
0
// Subclasses can override
void AccelStepper::step(long step)
{
    switch (_interface)
    {
        case FUNCTION:
            step0(step);
            break;

	case DRIVER:
	    step1(step);
	    break;
    
	case FULL2WIRE:
	    step2(step);
	    break;
    
	case FULL3WIRE:
	    step3(step);
	    break;  

	case FULL4WIRE:
	    step4(step);
	    break;  

	case HALF3WIRE:
	    step6(step);
	    break;  
		
	case HALF4WIRE:
	    step8(step);
	    break;  
    }
}
// Subclasses can override
void AccelStepper::step(uint8_t step)
{
    switch (_interface)
    {
        case FUNCTION:
            step0();
            break;

	case DRIVER:
	    step1(step);
	    break;
    
	case FULL2WIRE:
	    step2(step);
	    break;
    
	case FULL4WIRE:
	    step4(step);
	    break;  

	case HALF4WIRE:
	    step8(step);
	    break;  
    }
}
Beispiel #4
0
void Munkres::solve(double* icost, int* answer, int m, int n) {
	rows = m;
	cols = n;
	cost = new double*[rows];
	starred = new bool*[rows];

	primed = new bool*[rows];
	covered_rows = new bool[rows];
	covered_cols = new bool[cols];

	for (int i = 0; i < rows; i++) {
		covered_rows[i] = false;
	}
	for (int i = 0; i < cols; i++) {
		covered_cols[i] = false;
	}

	for (int i = 0; i < rows; i++) {
		cost[i] = new double[cols];
		starred[i] = new bool[cols];
		primed[i] = new bool[cols];

		for (int j = 0; j < cols; j++) {
			cost[i][j] = icost[(i * cols) + j];
			starred[i][j] = 0;
			primed[i][j] = 0;
		}
	}

	smallest = std::min(rows, cols);
	largest = std::max(rows, cols);

	if (rows > cols) {
		step0();
	} else {
		k = min_uncovered();

		step1();
	}

	int index = 0;
	for (int i = 0; i < rows; i++) {
		for (int j = 0; j < cols; j++) {
			answer[index] = starred[i][j];
			index++;
		}
	}

	for (int i = 0; i < rows; i++) {
		delete cost[i];
		delete primed[i];
		delete starred[i];
	}
	delete cost;
	delete primed;
	delete starred;
	delete covered_rows;
	delete covered_cols;

}
// Subclasses can override
void AccelStepper::step(long step)
{
    switch (_interface)
    {
        case FUNCTION:
            step0(step);
            break;

	case DRIVER:
	    step1(step);
	    break;

    }
}
Beispiel #6
0
// Subclasses can override
void AccelStepper::step(uint8_t step)
{
    switch (_pins)
    {
        case 0:
            step0();
            break;
	case 1:
	    step1(step);
	    break;
    
	case 2:
	    step2(step);
	    break;
    
	case 4:
	    step4(step);
	    break;  
    }
}
 // Subclasses can override
 void EightAccelStepper::step(uint8_t step)
 {
     switch (getPins())
     {
         case 0:
             step0();
             break;
         case 1:
             step1(step);
             break;
             
         case 2:
             step2(step);
             break;
             
         case 4:
             step4(step);
             break; 
             
         case 8:
             step8(step);
             break;   
     }
 }