Search in sources :

Example 1 with PositionEvent

use of com.robo4j.hw.rpi.serial.gps.PositionEvent in project robo4j by Robo4J.

the class GPSTest method main.

public static void main(String[] args) throws InterruptedException, IOException {
    GPS gps = new GPS();
    gps.addListener(new GPSListener() {

        @Override
        public void onEvent(PositionEvent event) {
            System.out.println(event);
        }

        @Override
        public void onEvent(VelocityEvent event) {
            System.out.println(event);
        }
    });
    gps.startAutoUpdate();
    System.out.println("Press enter to quit!");
    System.in.read();
    gps.shutdown();
}
Also used : GPSListener(com.robo4j.hw.rpi.serial.gps.GPSListener) GPS(com.robo4j.hw.rpi.serial.gps.GPS) VelocityEvent(com.robo4j.hw.rpi.serial.gps.VelocityEvent) PositionEvent(com.robo4j.hw.rpi.serial.gps.PositionEvent)

Aggregations

GPS (com.robo4j.hw.rpi.serial.gps.GPS)1 GPSListener (com.robo4j.hw.rpi.serial.gps.GPSListener)1 PositionEvent (com.robo4j.hw.rpi.serial.gps.PositionEvent)1 VelocityEvent (com.robo4j.hw.rpi.serial.gps.VelocityEvent)1