38 lines
528 B
Java
38 lines
528 B
Java
|
package org.hwo.pulscounter;
|
||
|
|
||
|
import java.io.RandomAccessFile;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.List;
|
||
|
|
||
|
import org.hwo.io.SerialPort;
|
||
|
|
||
|
public class PulsCounterInterface {
|
||
|
|
||
|
SerialPort port;
|
||
|
|
||
|
public PulsCounterInterface(String portName)
|
||
|
{
|
||
|
port = new SerialPort(portName);
|
||
|
}
|
||
|
|
||
|
public List<Integer> readCounter()
|
||
|
{
|
||
|
ArrayList<Integer> counter = new ArrayList<Integer>();
|
||
|
|
||
|
/*
|
||
|
if (port.open())
|
||
|
{
|
||
|
port.close();
|
||
|
}
|
||
|
*/
|
||
|
for (int i=0;i<32;i++)
|
||
|
counter.add( i * i);
|
||
|
|
||
|
return counter;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|