public void wake() { mSleepPin.high(); }
public void disable() { mEnablePin.high(); }
public void wake() { mSleepPin.high(); }
public void disable() { mEnablePin.high(); }
public void setDirection(int direction) { if (direction == FORWARD) { mDirPin.low(); } else if (direction == BACKWARD) { mDirPin.high(); } }
public void setDirection(int direction) { if (direction == FORWARD) { mDirPin.low(); } else if (direction == BACKWARD) { mDirPin.high(); } }
public void high(String name) { ((GpioPinDigitalOutput) get(name)).high(); }
public void setDrivingMode(int drivingMode) { switch (drivingMode) { case FULL_STEP: { mMs1Pin.low(); mMs2Pin.low(); break; } case HALF_STEP: { mMs1Pin.high(); mMs2Pin.low(); break; } case ONE_FOURTH_STEP: { mMs1Pin.low(); mMs2Pin.high(); break; } case ONE_EIGHTH_STEP: { mMs1Pin.high(); mMs2Pin.high(); break; } } }
@Override public void high(GpioPinDigitalOutput... pin) { if (pin == null || pin.length == 0) { throw new IllegalArgumentException("Missing pin argument."); } // ensure the requested pin has been provisioned for (GpioPinDigitalOutput p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } // set pin state high p.high(); } }
public void setDrivingMode(int drivingMode) { switch (drivingMode) { case FULL_STEP: { mMs1Pin.low(); mMs2Pin.low(); break; } case HALF_STEP: { mMs1Pin.high(); mMs2Pin.low(); break; } case ONE_FOURTH_STEP: { mMs1Pin.low(); mMs2Pin.high(); break; } case ONE_EIGHTH_STEP: { mMs1Pin.high(); mMs2Pin.high(); break; } } }
@Override public void high(GpioPinDigitalOutput... pin) { if (pin == null || pin.length == 0) { throw new IllegalArgumentException("Missing pin argument."); } // ensure the requested pin has been provisioned for (GpioPinDigitalOutput p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } // set pin state high p.high(); } }
public void test(String name) throws InterruptedException { GpioPinDigitalOutput pin = (GpioPinDigitalOutput) get(name); pin.export(PinMode.DIGITAL_OUTPUT); for (int i = 0; i < 200; i++) { pin.low(); Thread.sleep(100); pin.high(); Thread.sleep(100); } }
public void move(int distance, int interval, int drivingMode) throws InterruptedException { if (drivingMode != mDrivingMode) { setDrivingMode(drivingMode); } if (distance < 0) { setDirection(BACKWARD); } else { setDirection(FORWARD); } for (int i = 0; i < Math.abs(distance); i++) { mStepPin.high(); Thread.sleep(interval); mStepPin.low(); Thread.sleep(interval); } }
public void move(int distance, int interval, int drivingMode) throws InterruptedException { if (drivingMode != mDrivingMode) { setDrivingMode(drivingMode); } if (distance < 0) { setDirection(BACKWARD); } else { setDirection(FORWARD); } for (int i = 0; i < Math.abs(distance); i++) { mStepPin.high(); Thread.sleep(interval); mStepPin.low(); Thread.sleep(interval); } }
outputPin.high(); System.out.println(">>> pin: " + pin.toString() + " should be in the HIGH state.");
((GpioPinDigitalOutput) pin).high();