I have one small problem. Somewhere I found that I can program LPT port by writing to file "LPT1" But this code doesn't work. It outputs:
1
2
3
Here is my code:
public static void writeByte(byte data, String portName) throws IOException {
System.out.println("1");
FileOutputStream port = new FileOutputStream(portName);
System.out.println("2");
PrintStream printer = new PrintStream(port);
System.out.println("3");
printer.write(data);
System.out.println("4");
printer.println('\f');
System.out.println("5");
printer.flush();
System.out.println("6");
printer.close();
System.out.println("7");
port.close();
System.out.println("8");
}