Code example for SeekBar

Methods: getId

0
    noise.togglePlayback();
  } 
 
  public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch)
  { 
    if (seekBar.getId() == lPulseBar.getId())
    { 
      noise.setPulsePercent(progress, 0);
      lPulseText.setText("Servo 1(L Pos) pulse width = " + noise.getPulseMs(0) + "ms (" + noise.getPulseSamples(0) + " samples)");
    } 
    if (seekBar.getId() == lPulseBar2.getId())
    { 
      noise.setPulsePercent(progress, 1);
      lPulseText2.setText("Servo 2(L Neg) pulse width = " + noise.getPulseMs(1) + "ms (" + noise.getPulseSamples(1) + " samples)");
    } 
 
    if (seekBar.getId() == rPulseBar.getId())
    { 
      noise.setPulsePercent(progress, 2);
      rPulseText.setText("Servo 3(R Pos) pulse width = " + noise.getPulseMs(2) + "ms (" + noise.getPulseSamples(2) + " samples)");
    } 
 
    if (seekBar.getId() == rPulseBar2.getId())
    { 
      noise.setPulsePercent(progress, 3);
      rPulseText2.setText("Servo 4(R Neg) Pulse width = " + noise.getPulseMs(3) + "ms (" + noise.getPulseSamples(3) + " samples)");
    }