Class SerialBufferedDataExample


  • public class SerialBufferedDataExample
    extends Object
    This example code demonstrates how to perform serial communications using the Raspberry Pi. This example configures Pi4J to buffer received data in memory and will print the received data out via the console every ten seconds.
    Author:
    Robert Savage
    • Constructor Detail

      • SerialBufferedDataExample

        public SerialBufferedDataExample()
    • Method Detail

      • main

        public static void main​(String[] args)
                         throws InterruptedException,
                                IOException
        This example program supports the following optional command arguments/options: "--device (device-path)" [DEFAULT: /dev/ttyAMA0] "--baud (baud-rate)" [DEFAULT: 38400] "--data-bits (5|6|7|8)" [DEFAULT: 8] "--parity (none|odd|even)" [DEFAULT: none] "--stop-bits (1|2)" [DEFAULT: 1] "--flow-control (none|hardware|software)" [DEFAULT: none]
        Parameters:
        args -
        Throws:
        InterruptedException
        IOException