Author Topic: Need some ideas on what to display on an LCD  (Read 4975 times)

0 Members and 1 Guest are viewing this topic.

Offline masilver

  • Thread Starter
  • Posts: 14
Need some ideas on what to display on an LCD
« on: Wed, 08 August 2018, 01:07:58 »
After much hacking around in the qmk firmware (I'm not much of a C programmer), I was finally able to get an LCD connected to my 122-key Model M.  I will integrate it into the shell next.
201484-0

So far, I have CAPS LOCK, NUM LOCK and total key press displayed.  I probably don't need CAPS LOCK displayed, as the keyboard's caps lock key has been remapped.

My question is, what should I display on the LCD?  I can't think of anything else.

...Thanks...
...Michael...

Offline ErgoMacros

  • Posts: 313
  • Location: SF Bay Area
Re: Need some ideas on what to display on an LCD
« Reply #1 on: Wed, 08 August 2018, 02:27:48 »
I really want a calculator mode built into my keyboards.
My Cherry (Reuters) G80-9009 Keyboard has a calculator mode built in. It is way cool.

I have some code for a simple RPN calculator that runs on a Beetle ATmega32u4-based
Microcontroller that I'd be happy to share. It's not tied into the rest of the keyboard code, yet.
16 characters is not an unreasonable display foe a lot of calculations, for example it can display
-9,999,999.99999, or similar.

If you're doing modifiers on a more complex programable keyboard you could display something like:
  • ____ - No shift down
  • Shft  - Single-shot shift mode (next key is shifted)
  • SHFT - Shift modifier locked down (everything is shifted until Shift is pressed again)

Repeat for Ctl, Win, Opt, so with everything locked you get "SHFT CTL WIN OPT" displayed. (16 characters, 1 row)
If you support use SpaceFn you could display that and the current layer (name or number) on line 2.

All the best!
Today's quote: '...“but then the customer successfully broke that.”

Offline nmur

  • ಠ_ಠ
  • Posts: 1539
  • Location: Sydney
Re: Need some ideas on what to display on an LCD
« Reply #2 on: Wed, 08 August 2018, 02:37:43 »
i'd put a simple date and time clock on it if it were me

i can't think of anything else that i wouldn't be able to get from the computer itself, and a clock is not always visible if you're running a full screen application or something

Offline masilver

  • Thread Starter
  • Posts: 14
Re: Need some ideas on what to display on an LCD
« Reply #3 on: Wed, 08 August 2018, 03:25:46 »
These are great ideas.  I never though of a calculator.  I can see that being a can of worms, at least with my C programming skills on a Teensy.  Very cool idea.  I'm going to think about that. :-(

The clock is a great idea, but there is no real-time clock on the Teensy.  I think you can add a board that comes with a battery and RTC.  It does have a ms timer built-in, but that's not of much use.  The other thing qmk doesn't offer me is a reasonable loop to update a time and date from, i.e., real time updating of the clock.  I think it's because I'm only using the converter code.

...Michael...

Offline vvp

  • Posts: 886
Re: Need some ideas on what to display on an LCD
« Reply #4 on: Wed, 08 August 2018, 05:21:53 »
The end of this post contains the list of things which I'm showing on the LCD. I plan to change the layer name with the configuration name and layer number in the future though. Also it is not QMK firmware.

I would not be inclined to put a calculator there. A keyboard is used with a computer and there are many great free calculator applications to used on a PC. From simple ones like calc, through interpreters (like python, ghci) to very powerful environments for math like wxmaxima or octave.

Offline ErgoMacros

  • Posts: 313
  • Location: SF Bay Area
Re: Need some ideas on what to display on an LCD
« Reply #5 on: Wed, 08 August 2018, 15:26:28 »
Yeah, sometimes it's nice to just add up a few numbers without launching an app.
Also, looks like I neglected to suggest:
   include a key in calc mode that sends the results out the USB port (like Paste) and then drops out of calc mode.

Up to the OP of course. Just offering a suggestion.  :D
Today's quote: '...“but then the customer successfully broke that.”

Offline vvp

  • Posts: 886
Re: Need some ideas on what to display on an LCD
« Reply #6 on: Thu, 09 August 2018, 01:41:35 »
The biggest problem with a calculator in a keyboard is that it will not show you enough history. Well that is the problem with most cheap calculators :-)

"Pasting" from calculator mode: You mean a calculator in a keyboard as a way to enter a number in an application which does not accept expressions in the input field. I can imagine that to be occasionally useful. Although I cannot think of an application where I would use it just now.

Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: Need some ideas on what to display on an LCD
« Reply #7 on: Thu, 09 August 2018, 06:11:10 »
WPM counter.  Show current WPM and maximum.

I would use a n-sized circular buffer of bytes with timings of the last key strokes and present the WPM as a value calculated from the average. Provide a valid reading only when the buffer is full, thus requiring at least n readings before the counter appears.
Clear the buffer when nothing has been typed for m seconds. Do not start recording until the delay is shorter than o milliseconds. Would require a bit of trial and tweaking to get the values of n, m and o.
You might need to count the current key stroke measurement in milliseconds in a 16-bit integer and shift it down to store into the buffer. Easiest to do in a firmware that has a millisecond loop but if it doesn't, you could use the SOF interrupt for the clock: the USB host triggers a SOF ("start of frame") every millisecond.
« Last Edit: Thu, 09 August 2018, 06:17:40 by Findecanor »

Offline vvp

  • Posts: 886
Re: Need some ideas on what to display on an LCD
« Reply #8 on: Thu, 09 August 2018, 16:06:39 »
WPM?
Maybe rather number of key presses, or both :)
« Last Edit: Thu, 09 August 2018, 16:08:14 by vvp »

Offline xtrafrood

  • formerly csmertx
  • * Elevated Elder
  • Posts: 2715
  • Location: Gainesville, FL
  • wildling
Re: Need some ideas on what to display on an LCD
« Reply #9 on: Thu, 09 August 2018, 18:45:22 »
I think a period specific digital clock to match the keyboard would look rather classy.

Offline ErgoMacros

  • Posts: 313
  • Location: SF Bay Area
Re: Need some ideas on what to display on an LCD
« Reply #10 on: Thu, 09 August 2018, 19:03:45 »
Following vvp's Katy link (cool project) I see there's a list of LCD functions there, for your consideration.
From: https://deskthority.net/workshop-f7/katy-keyboard-or-k80cs-key80-contoured-split-t8524-150.html

Quote
>>> What's the purpose of the screen?
It shows:
current layer name (one of Normal, Keypad, Function)
one letter indicator whether macros or programs are enabled
light sensor raw value (it equal to about ½ of lux)
which lock is active (Caps/Scrol/Num) .. these are indicated also by the LEDs (which have brightness control based on the data from the light sensor)
small help indicating what is the state of the keyboard when one is programming macros or remaping keys
a value of the current divisor when configuring how many times the mouse pointer speed or the mouse wheel speed is slower than the keyboard polling rate (which is 2 ms)
error messages (e.g. "USB Wait" when host is not communicating with the keyboard)
Today's quote: '...“but then the customer successfully broke that.”

Offline masilver

  • Thread Starter
  • Posts: 14
Re: Need some ideas on what to display on an LCD
« Reply #11 on: Sat, 11 August 2018, 14:27:30 »
Damn, these are really some good ideas.  I may be able to add the words per minute.  I did find a loop to hook into, but I'll have to figure out the timing.  One loop is somewhere south of a ms.  Actually, nevermind, there is a ms clock.  I just remembered.

Displaying the time will require an additional purchase of a RTC, which I'm not opposed to, but then I'd have to write the code to set the clock and I need a break from heavy troubleshooting.

I did add code to store the keycount in the EEPROM and also display "SUSPENDED" if the computer is in sleep mode.

I'm already addicted to watching my key count rise, but I'm also a bit of a stats nerd.

201861-0

BTW, I posted my code changes on github:  https://github.com/masilver99/qmk_firmware

I guess I'll work on WPM next.  I need more stats!

...Michael...

Offline FenixtheCorgi

  • Posts: 4
Re: Need some ideas on what to display on an LCD
« Reply #12 on: Mon, 13 August 2018, 01:53:46 »
Maybe make a plugin for things like CPU utilization, HDD activity, maybe even make it display currently not responding processes or things like that? I believe RIVATuner will output to certain logitech keyboards, maybe it's possible to make it output to yours?
Current boards-
Daily Driver- IBM Pingmaster (Alps SKCC Greens)
Second fiddle- IBM Model M
Board I carry with me- Kingston HyperX (Cherry MX blues)
Boards I break out on occasion, or for LAN parties
Apple Extended Keyboard II (Alps SKCM Cream)
Chicony KB-5161 (With SMK 2nd generation!)

Offline vvp

  • Posts: 886
Re: Need some ideas on what to display on an LCD
« Reply #13 on: Mon, 13 August 2018, 03:53:56 »
@masilver:
I added the key press counter as well. When typing the LCD shows the counter. When typing stops, after a timeout, the light sensor value is shown again. It is kind of stupid feature but very easy to implement and it is fun to follow the counter to rise :-D Well I bet it gets boring over time.

@FenixtheCorgi:
That requires either the custom keyboard driver or making the keyboard a composite device ... probably with a serial port and a custom protocol to update keyboard LCD from a PC application. There are some billboard and display classes in USB spec but I do not know whether they can be used.

Summary: this is a major project compared to keystroke counter (which takes only about an hour to do) and it will require also custom software on the PC side. I'm not also sure why it would be good to show this on a keyboard LCD. It looks to me that it would be better to show it on the monitor (where applications for this already exist).