Package lejos.nxt

Examples of lejos.nxt.SoundSensor


    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, soundSensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    SoundSensor soundSensor = new SoundSensor(SensorPort.S1);
   
    int sensorValue;
    for (int i = 1; i <= anzahlMessungen; i++) {
      long startTime = System.currentTimeMillis();
      sensorValue = soundSensor.readValue();
      System.out.println("Messung Nr. " + i + "\tergab Lautst�rke von "
          + sensorValue + "% " + "\t(Messdauer: "
          + (System.currentTimeMillis() - startTime) + "ms)");
    }
  }
View Full Code Here

TOP

Related Classes of lejos.nxt.SoundSensor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.