public void backward() throws RuntimeIOException { forward.off(); backward.on(); }
public void forward() throws RuntimeIOException { forward.on(); backward.off(); }
/** * Set the colour to be sampled. * f S2 S3 Photodiode * 0 L L Red * 1 H H Green * 2 L H Blue * 3 H L Clear (no filter) * @param f Filter */ public void setFilter(Filter f) { switch (f) { case RED: s2.off(); s3.off(); break; case GREEN: s2.on(); s3.on(); break; case BLUE: s2.off(); s3.on(); break; default: // Clear s2.on(); s3.off(); } }
private void scanKeys() { for (byte c=0; c<cols.length; c++) { // Begin column pulse output. cols[c].on(); for (byte r=0; r<rows.length; r++) { // keypress is active low so invert to high. values[r][c] = rows[r].isActive(); } // Set pin to high impedance input. Effectively ends column pulse. cols[c].off(); } } }
/** * @param speed * Range 0..1 * @throws RuntimeIOException if an I/O error occurs */ @Override public void forward(float speed) throws RuntimeIOException { motorBackwardControlPin.off(); motorForwardControlPin.on(); motorPwmControl.setValue(speed); valueChanged(speed); }
/** * @param speed * Range 0..1 * @throws RuntimeIOException if an I/O error occurs */ @Override public void backward(float speed) throws RuntimeIOException { motorForwardControlPin.off(); motorBackwardControlPin.on(); motorPwmControl.setValue(speed); valueChanged(-speed); }