// 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 (;;) {