int calculateRow( unsigned long column ) { OutputLow(Y1); OutputHigh(Y2); OutputHigh(Y3); OutputHigh(Y4); if ( column & ~__PIO_PDSR ) return 1; OutputHigh(Y1); OutputLow(Y2); if ( column & ~__PIO_PDSR ) return 2; OutputHigh(Y2); OutputLow(Y3); if ( column & ~__PIO_PDSR ) return 3; OutputHigh(Y3); OutputLow(Y4); if ( column & ~__PIO_PDSR ) return 4; return 5; }
void C_ROULETTE::SetRotSpeed(int speed) { if(speed <= 0) { Stop(); } else if(speed < 10) { int swFlag = speed - 1; for(U32 j=0;j<4;j++) { if(swFlag & (1 << j)) { OutputHigh(Switches[j]); } else { OutputLow(Switches[j]); } } OutputHigh(MOTOR_POWER); currentSpeed = speed; } }
void C_ROULETTE::Stop() { currentSpeed = 0; OutputLow(MOTOR_POWER); }
static void PullRowsLow( void ){ OutputLow( Y1 ); OutputLow( Y2 ); OutputLow( Y3 ); /* In error */ OutputLow( Y4 ); }