Package com.pi4j.io.serial

Examples of com.pi4j.io.serial.Serial


       
       
       

        // create an instance of the serial communications class
        final Serial serial = SerialFactory.createInstance();

        // create and register the serial data listener
        serial.addListener(new SerialDataListener() {
            @Override
            public void dataReceived(SerialDataEvent event) {
                // print out the data received to the console
                String v = event.getData();
                //System.out.print(v);
               
               
               
                hs.store(v,fm.getSeial());
                System.out.print(ANSI_WHITE + v + " m/s" +ANSI_GREEN);
               
               

            }
        });

        run_pin.high();
       
        try {
            // open the default serial port provided on the GPIO header
            serial.open(Serial.DEFAULT_COM_PORT, 38400);

            // continuous loop to keep the program running until the user terminates the program
            for (;;) {
         
               
View Full Code Here

TOP

Related Classes of com.pi4j.io.serial.Serial

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.