use of com.robo4j.hw.rpi.imu.bno.DataListener in project robo4j by Robo4J.
the class Bno080AccelerometerExample method main.
public static void main(String[] args) throws Exception {
DataListener listener = (DataEvent3f event) -> System.out.println("ShtpPacketResponse: " + event);
System.out.println("BNO080 SPI Accelerometer Example");
// Change here to use other modes of communication
Bno080Device device = Bno080Factory.createDefaultSPIDevice();
device.addListener(listener);
device.start(SensorReportId.ACCELEROMETER, 100);
System.out.println("Press <Enter> to quit!");
System.in.read();
device.shutdown();
}
use of com.robo4j.hw.rpi.imu.bno.DataListener in project robo4j by Robo4J.
the class Bno080Example method main.
public static void main(String[] args) throws Exception {
DataListener listener = (DataEvent3f event) -> System.out.println("ShtpPacketResponse: " + event);
System.out.println("BNO080 SPI Rotation Vector Example");
// Change here to use other modes of communication
Bno080Device device = Bno080Factory.createDefaultSPIDevice();
device.addListener(listener);
device.start(SensorReportId.ROTATION_VECTOR, 1000);
System.out.println("Press <Enter> to quit!");
System.in.read();
device.shutdown();
}
Aggregations