From 24bb50e594f6d1aec56fe17fb4b164090c446e33 Mon Sep 17 00:00:00 2001 From: Russell Senior Date: Sat, 18 May 2019 00:45:09 -0700 Subject: [PATCH] add a feature to show text hidden by printing mechanism After 500ms of printing inactivity, roll platen up N lines (currently 8) to show state to user. Before printing again, roll platen back down N+1, then up one to return to the current location for new printing. This enhances the experience for the user, as they can see what they just typed or what the computer just typed back at them. Signed-off-by: Russell Senior --- README.md | 9 ++++++++- lqp02-teletype.ino | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7240e42..d7f0f5e 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,17 @@ does RTS/CTS hardware flow control, so the Teensy program looks for XON/XOFF fro and stops reading from the computer serial port when it last saw XOFF, which lets the hardware UART's flow control to just work. +One of the disadvantages of the LQP02 is that it was intended as a strictly output device, and +as a result being able to see what you are typing is not prioritized. I saw a video on youtube +(https://www.youtube.com/watch?v=TRxz4x45i54) which used the vertical motion control to roll +the platen to lift the active printing line up above the printing mechanism at appropriate +moments so that you can see what you have typed. On the LQP02, 8 lines seems about right. +When rolling the paper back down to continue printing, I am rolling an extra line down and then +back up one to hopefully improve vertical registration. Thanks Blake Thomas for the idea. + There are a bunch of TODO's: * Fix the terminal thinking there are only 24 lines per page and sending a form feed; - * Look into using platen motion to show what's just been printed (Wheelwriter is better at this); * Add a toggle switch to switch between Line and Local mode; * Support the mini-DIN8 connected Sun Keyboard; * Support output to an IBM Wheelwriter; diff --git a/lqp02-teletype.ino b/lqp02-teletype.ino index c4dca63..1902dca 100644 --- a/lqp02-teletype.ino +++ b/lqp02-teletype.ino @@ -12,6 +12,29 @@ static const int clockPin = 4; static const int dataPin = 5; bool debug = 0; bool local = 0; +bool rolledUp = 0; +int linesToRoll = 8; + +int rollUpToShow() { + if(!rolledUp) { + for (int i=0 ; i(); int fromComputer; int fromPrinter; + unsigned long sinceLastPrint = millis() - lastPrint; + + if (timedBefore && sinceLastPrint > 500) { + rollUpToShow(); + } if (Computer.available() > 0 && pxon) { fromComputer = Computer.read(); if (!local) { + rollDownToPrint(); Printer.write(fromComputer); + lastPrint = millis(); + timedBefore = 1; } if (debug) { Serial.printf("computer: 0x%02x %c",fromComputer,fromComputer);