//coordenadas do centro da maquina void printingMachine(double x, double z){ glPushMatrix(); glTranslated(x,0,z); machine(machineX,machineY,machineZ,machineXaux,machineYaux); glPushMatrix(); glTranslated(-guillotineSupportX,guillotineSupportY,guillotineSupportZ); guillotineSupport(guillotineSupportSide,guillotineSupportHeight); glPopMatrix(); glPushMatrix(); glTranslated(guillotineSupportX,guillotineSupportY,guillotineSupportZ); guillotineSupport(guillotineSupportSide,guillotineSupportHeight); glPopMatrix(); glPushMatrix(); glTranslated(0.0,machineY + teapotSize/2.0,0.0); glFrontFace(GL_CW); glutSolidTeapot(teapotSize); glFrontFace(GL_CCW); glPopMatrix(); glPushMatrix(); glTranslated(0,0,conveyorZ+machineZ); conveyorBelt(conveyorX,conveyorY,conveyorZ); glPopMatrix(); glPopMatrix(); }
void processController() { //static bool 5uButton = false; static byte rightJoystickY, leftJoystickY, prevRightJoystickY = 0, prevLeftJoystickY = 0; rightJoystickY = readRightJoystickYAxis(); leftJoystickY = readLeftJoystickYAxis(); static bool rightDriveMoving = false; // Primary Controller if (abs(rightJoystickY) > MIN_JOYSTICK_THRESHOLD) { if (prevRightJoystickY != rightJoystickY) { rightDriveMoving = true; turnMotor(driveRightB, driveRightF, rightJoystickY); } } else { if (rightDriveMoving) { rightDriveMoving = false; turnMotor(driveRightB, driveRightF, 0); } } static bool leftDriveMoving = false; if (abs(leftJoystickY) > MIN_JOYSTICK_THRESHOLD) { if (prevLeftJoystickY != leftJoystickY) { leftDriveMoving = true; turnMotor(driveLeftB, driveLeftF, leftJoystickY); } } else { if (leftDriveMoving) { leftDriveMoving = false; turnMotor(driveLeftB, driveLeftF, 0); } } prevRightJoystickY = rightJoystickY; prevLeftJoystickY = leftJoystickY; if (isButtonPressed(Btn5U)) { ballIntake(-100); } else { if (isButtonPressed(Btn5D)) { ballIntake(100); } else ballIntake(0); } // if (isButtonPressed(Btn5D)) // { // ballIntake(100); // } else { // ballIntake(0); // } if (isButtonClick(Btn6U)) jawControle(0); if (isButtonClick(Btn6D)) jawControle(1); // Secondary Controller conveyorBelt(50); //<- Conveyor Speed if (isButtonClick(Btn8DXmtr2)) startShooter(100); //<- Shooter Speeds if (isButtonClick(Btn8LXmtr2)) startShooter(80); //<- Shooter Speeds if (isButtonClick(Btn8UXmtr2)) startShooter(60); //<- Shooter Speeds if (isButtonClick(Btn8RXmtr2)) startShooter(40); //<- Shooter Speeds if (isButtonClick(Btn7DXmtr2)) stopShooter(); }