示例#1
0
 /**
  * Set the alpha coefficient for the low-pass filter. y[n] = alpha*y[n-1] + (1-alpha)*x[n]. I.e.,
  * values near one represent low-pass filters with greater effect. The nominal sample rate is
  * 500Hz.
  *
  * @param alpha [0,1].
  */
 public void setLPF(double alpha) {
   assert (alpha >= 0 && alpha <= 1.0);
   int v = (int) (alpha * 65536);
   orc.doCommand(
       0x3000, new byte[] {(byte) port, (byte) ((v >> 8) & 0xff), (byte) ((v >> 0) & 0xff)});
 }
示例#2
0
 public static void main(String[] args) {
   Orc orc = new Orc("Limburger", 12);
   System.out.println(orc);
   orc.change("Bob", 19);
   System.out.println(orc);
 }
示例#3
0
 public double getVoltageUnfiltered() {
   OrcStatus status = orc.getStatus();
   return status.analogInput[port] / 65535.0 * 5; // 4.096;
 }