tkVFD


NametkVFD JSON
Version 1.1.0 PyPI version JSON
download
home_page
SummaryThe tkVFD module allows for easy inclusion of customizable segmented alpha-numeric displays into any Tkinter application and supports both 16-segment and 7-segment geometries.
upload_time2024-01-11 01:36:57
maintainer
docs_urlNone
author
requires_python>=3.11
licenseMIT License Copyright (c) 2023 Andrew Getman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords tkinter tk vfd vacuum fluorescent display lcd liquid crystal display python display
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tkVFD

## Overview

The [tkVFD module](https://github.com/andrewdget/tkVFD) allows for easy inclusion of customizable segmented alpha-numeric displays into any [Tkinter](https://docs.python.org/3/library/tkinter.html) application and supports both 16-segment and 7-segment geometries.

The displays generated by tkVFD are styled after "Vacuum Fluorescent Displays" or VFDs, a beautiful cathodoluminescent predecessor to the modern LCD digital/alpha-numeric displays *(though the tkVFD package can also simulate the look of backlit LCD displays by not displaying the distinctive "mesh control grid" unique to VFDs)*. See [Background](https://github.com/andrewdget/tkVFD/tree/main#background) section for more.

### 16-Segment Display Example
 <p align='center'>
	<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg16_example.png?raw=true' width='850' height='auto'><br>
	<b>Common 16-segment ASCII Characters</b><br><br>
	<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg16_color_example.png?raw=true' alt='Example of 16-segment Display Color Customization' width='850' height='auto'>
	<b>Example of 16-segment Display Color Customization</b>
</p>

### 7-Segment Display Example
 <p align='center'>
	<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg7_example.png?raw=true' alt='Common 7-segment ASCII Characters' width='850' height='auto'>
	<b>Common 7-segment ASCII Characters</b><br><br>
	<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg7_color_example.png?raw=true' alt='Example of 7-segment Display Color Customization' width='850' height='auto'>
	<b>Example of 7-segment Display Color Customization</b>
</p>

## Installation

Install tkVFD with **pip**:

```
python3 -m pip install --upgrade pip
python3 -m pip install tkVFD
```

## Usage

### 16-Segment Displays
	
class **```tkVFD.seg16(parent, *option=value):```**<br>
Tkitner-compatible 16-segment "VFD/LCD like" display that can be used everywhere Tkinter expects a canvas object.
			
OPTIONS:<br>
**parent** - Parent Tkinter object.
					
**width** - Display width in pixels. *Note: If only one display dimension parameter is passed (i.e. width but not height or vice versa) the unspecified dimension parameter is adjusted automatically to preserve default aspect ratio.*
					
**height** - Display height in pixels. *Note: If only one display dimension parameter is passed (i.e. height but not width or vice versa) the unspecified dimension parameter is adjusted automatically to preserve default aspect ratio.*
					
**on_color** - The color of the display segments which are "switched on" as expressed as an RGB row vector i.e ```[red, green, blue]``` where each color is represented as a number between 0 and 255 *(default: ```on_color=[204, 246, 250]```).*
					
**off_color** - The color of the display segments which are "switched off" as expressed as an RGB row vector i.e. ```[red, green, blue]``` where each color is represented as a number between 0 and 255 *(default: ```off_color=[32, 32, 32]```).*

**bg** - Background color of the display canvas, accepts all standard Tkinter color inputs, including standard color names and 4/8/12 bit hexadecimal RGB color formats *(default: ```bg='black'```).*

**use_DP** - If ```True``` the display will include a decimal point segment *(default: ```use_DP=False```).*

**use_CC** - If ```True``` the display will include colon segments *(default: ```use_CC=False```).*

**use_Grid** - If ```False``` the display will not include a visual "grid" making the display look more "LCD like" *(default: ```use_Grid=True```).*
					
method **```.control(switches, *option=value)```**<br>
This method is used to directly control which segments of the display are "switched on" or "off".

>[!IMPORTANT]
>If neither this method or the ```.char()``` method are used the display will exist internally, but it will not be visible in the Tkinter application as the state (i.e. on or off) of the display's segment will be indeterminate.
					
OPTIONS:<br>
**switches** - A row vector with 16 elements, each describing the binary state (i.e. ```1=on```, ```0=off```) of the corresponding segment of the display in alphabetical order from A-M (and applicable sub-segments) according to the diagram below. *Note: Control over decimal point and/or colon segments is handled separately via the options below.*

<p align='center'>
	<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg16_map.png?raw=true' alt='Map of segment names for a 16-Segment display, including decimal point (DP) and colon (CC) segments.' width='auto' height='300'>
</p>
							
**DP** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the decimal point segment, assuming the decimal point segment was enabled when the display was initialized (i.e. ```tkVFD.seg16(parent, use_DP=True)```).

**CC** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the colon segments, assuming the colon segments were enabled when the display was initialized (i.e. ```tkVFD.seg16(parent, use_CC=True)```.
							
method **```.char(char, option=value)```**<br>

This method is used to automatically display alpha-numeric characters. Alpha-numeric characters supported by ```.seg16()``` are A-Z (capital and lower-case) and 0-9 (see [Background](https://github.com/andrewdget/tkVFD/tree/main#background) section for more).

>[!IMPORTANT]
>If neither this method or the ```.control()``` method are used the display will exist internally, but it will not be visible in the Tkinter application as the state (i.e. on or off) of the display's segment will be indeterminate.
					
OPTIONS:
**char** - A single alpha-numeric string character (i.e. ```'A'``` or ```'9'```), see above for supported characters.
							
**DP** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the decimal point segment, assuming the decimal point segment was enabled when the display was initialized (i.e. ```tkVFD.seg16(parent, use_DP=True)```).
							
**CC** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the colon segments, assuming the colon segments were enabled when the display was initialized (i.e. ```tkVFD.seg16(parent, use_CC=True)```.

method **```.clear()```**<br>
This method resets the state of the display after being set and must be called before either ```.control()``` or ```.char()``` can used again on an existing display.

>[!IMPORTANT]
>In order to update an existing display the ```.clear()``` method must be called before either ```.control()``` or ```.char()``` can used again.

Example:

```
import tkinter as tk
import tkVFD
import time

def change2nine():
	'''example function for resetting and updating tkVFD displays'''

	# reset display states so they can be updated
	left_disp.clear()
	right_disp.clear()

	# update the displays, via both methods, to show the number "9"
	left_disp.control([1,1,1,1,0,1,1], DP=0, CC=None).pack(side=tk.LEFT)
	right_disp.char('9', DP=None, CC=0).pack(side=tk.LEFT)

root=tk.Tk()
root.title('7-Segment Display Example')

# initialize an example displays
left_disp = tkVFD.seg7(root, height=200, use_DP=True)

right_disp = tkVFD.seg7(root, height=200, use_CC=True)

# disp the number "3" via direct control & using .pack layout management method
left_disp.control([1,1,1,1,0,0,1], DP=1, CC=None)
left_disp.pack(side=tk.LEFT)

# disp the number "3" via 'char' shortcut
right_disp.char('3', DP=None, CC=1)
right_disp.pack(side=tk.LEFT)

# after 5 seconds, call function to change display to "9"s
root.after(5000, change2nine)

root.mainloop()
```

### 7-Segment Displays

class **```tkVFD.seg7(parent, option=value):```**<br>
Tkitner-compatible 7-segment "VFD/LCD like" display that can be used everywhere Tkinter expects a canvas object.

OPTIONS:<br>
**parent** - Parent Tkinter object.

**width** - Display width in pixels. *Note: If only one display dimension parameter is passed (i.e. width but not height or vice versa) the unspecified dimension parameter is adjusted automatically to preserve default aspect ratio.*


**height** - Display height in pixels. *Note: If only one display dimension parameter is passed (i.e. height but not width or vice versa) the unspecified dimension parameter is adjusted automatically to preserve default aspect ratio.*

**on_color** - The color of the display segments which are "switched on" as expressed as an RGB row vector i.e ```[red, green, blue]``` where each color is represented as a number between 0 and 255 *(default: ```on_color=[204, 246, 250]```)*.

**off_color** - The color of the display segments which are "switched off" as expressed as an RGB row vector i.e. ```[red, green, blue]``` where each color is represented as a number between 0 and 255 *(default: ```off_color=[32, 32, 32]```)*.

**bg** - Background color of display canvas, accepts all standard Tkinter color inputs, including standard color names and 4/8/12 bit hexadecimal RGB color formats *(default: ```bg='black'```)*.

**use_DP** - If ```True``` the display will include a decimal point segment *(default: ```use_DP=False```)*.

**use_CC** - If ```True``` the display will include colon segments *(default: ```use_CC=False```)*.

**use_Grid** - If ```False``` the display will not include a visual "grid" making the display look more "LCD like" *(default: ```use_Grid=True```)*.

method **```.control(switches, option=value)```**<br>
This method is used to directly control which segments of the display are "switched on" or "off".

>[!IMPORTANT]
>If neither this method or the ```.char()``` method are used the display will exist internally, but it will not be visible in the Tkinter application as the state (i.e. on or off) of the display's segment will be indeterminate.

OPTIONS:<br>
**switches** - A row vector with 7 elements, each describing the binary state (i.e. ```1=on```, ```0=off```) of the corresponding segment of the display in alphabetical order from A-G according to the diagram below. *Note: Control over decimal point and/or colon segments is handled separately via the options below.*

<p align='center'>
	<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg7_map.png?raw=true' alt='Map of segment names for a 7-Segment display, including decimal point (DP) and colon (CC) segments.' width='auto' height='300'>
</p>

**DP<** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the decimal point segment, assuming the decimal point segment was enabled when the display was initialized (i.e. ```tkVFD.seg7(parent, use_DP=True)```).

**CC** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the colon segments, assuming the colon segments were enabled when the display was initialized (i.e. ```tkVFD.seg7(parent, use_CC=True)```.

method **```.char(char, option=value)```**<br>

This method is used to automatically display common alpha-numeric characters. Alpha-numeric characters supported by ```.seg7()``` are capital A-Z and 0-9. *Note: 7-Segment displays are best suited for numeral-only displays. For displays required to represent alphabetical characters, 16-Segment display are recommended. (see [Background](https://github.com/andrewdget/tkVFD/tree/main#background) section for more)*

>[!IMPORTANT]
>If neither this method or the ```.control()``` method are used the display will exist internally, but it will not be visible in the Tkinter application as the state (i.e. on or off) of the display's segment will be indeterminate.

OPTIONS:<br>
**char** - A single alpha-numeric string character (i.e. ```'A'``` or ```'9'```), see above for supported characters.

**DP** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the decimal point segment, assuming the decimal point segment was enabled when the display was initialized (i.e. ```tkVFD.seg7(parent, use_DP=True)```.

**CC** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the colon segments, assuming the colon segments were enabled when the display was initialized (i.e. ```tkVFD.seg7(parent, use_CC=True)```.
							
method **```.clear()```**<br>
This method resets the state of the display after being set and must be called before either ```.control()``` or ```.char()``` can used again on an existing display.

>[!IMPORTANT]
>In order to update an existing display the ```.clear()``` method must be called before either ```.control()``` or ```.char()``` can used again.

Example:

```
import tkinter as tk
import tkVFD
import time

def change2h():
	'''example function for resetting and updating tkVFD displays'''

	# reset display states so they can be updated
	left_disp.clear()
	right_disp.clear()

	# update the displays, via both methods, to show the letter "H" and "h", respectively
	left_disp.control([0,0,1,1,0,0,1,1,1,1,0,0,0,0,0,0], DP=0, CC=None).pack(side=tk.LEFT)
	right_disp.char('h', DP=None, CC=0).pack(side=tk.LEFT)

root=tk.Tk()
root.title('7-Segment Display Example')

# initialize an example displays
left_disp = tkVFD.seg16(root, height=200, use_DP=True)

right_disp = tkVFD.seg16(root, height=200, use_CC=True)

# disp the letter "G" via direct control & using .pack layout management method
left_disp.control([1,1,0,1,1,1,1,1,0,1,0,0,0,0,0,0], DP=1, CC=None)
left_disp.pack(side=tk.LEFT)

# disp the letter "g" via 'char' shortcut
right_disp.char('g', DP=None, CC=1)
right_disp.pack(side=tk.LEFT)

# after 5 seconds, call function to change display to "H" and "h", respectively
root.after(5000, change2h)

root.mainloop()
```

## Background

A Vacuum Fluorescent Display (VFD) is a analog-digital display device once commonly used in consumer electronics.

<p align='center'>
	<img src='https://upload.wikimedia.org/wikipedia/commons/d/d3/Vacuum_fluorescent_2.jpg' alt='Example of a VFD in a Hi-Fi Sterio System' width='auto' height='450'><sub>[1]</sub><br>
	<b>Example of a VFD in a Hi-Fi Sterio System</b>
</p>

VFDs function in a similar fashion to the Liquid Crystal Display (LCD) **but** operate on a very different principle; cathodoluminescense. Each tube in a VFD has a mesh control grid and phosphor-coated carbon anode that is bombarded by electrons emitted from a cathode filament. This allows VFDs to natively emit a very bright light with high contrast and can support displays with multiple elements of various colors, which LCDs can not (hence, most must come equipped with a backlight).<sub>[1]</sub>

VFDs, like LCDs, come in many configurations, however, the two most common are:

- **seven-segment (7-segment) displays;** As the name suggests, displays of this type are made up of seven independent segments and are best suited for numeral only displays (such as a digital clock). It is possible for these displays to represent alphabetical characters but the clarity/unambiguity is generally poor as a result of limited available segment geometries (for example the letter "Y"). Furthermore, it is not generally possible to differentiate between capitol/lower case characters. For applications where these limitations are problematic, 16-Segment displays offer a solution. <sub>[2]</sub>

- **sixteen-segment (16-segment) displays;** As the name suggests, displays of this type are made up of 16 independent segments. 16-segment displays expand on the functionality of 7-segment displays by splitting all horizontal segments in half, adding two central-vertical segments, and four diagonal segments. These additional segments allow for significantly more clear representation of alpha-numeric characters/symbols, including capitol/lower-case letters. <sub>[3]</sub>

<p align='center'>
	<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg7_map.png?raw=true' alt='Map of segment names for a 7-Segment display, including decimal point (DP) and colon (CC) segments.' width='auto' height='400'>
	<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg16_map.png?raw=true' alt='Map of segment names for a 16-Segment display, including decimal point (DP) and colon (CC) segments.' width='auto' height='400'><br>
	<b>7-segment Geometry (left), 16-segment Geometry (right)</b>
</p>

## References

[1] https://en.wikipedia.org/wiki/Vacuum_fluorescent_display<br>
[2] https://en.wikipedia.org/wiki/Seven-segment_display<br>
[3] https://en.wikipedia.org/wiki/Sixteen-segment_display<br>

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tkVFD",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "\"Andrew G.\" <andrewdget@gmail.com>",
    "keywords": "tkinter,tk,VFD,Vacuum Fluorescent Display,LCD,Liquid Crystal Display,python,display",
    "author": "",
    "author_email": "\"Andrew G.\" <andrewdget@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/74/b4/2f0af697978327bf9cf4a2f3ca59573b007a0c828c3e1f324135fe4d6ff8/tkVFD-1.1.0.tar.gz",
    "platform": null,
    "description": "# tkVFD\n\n## Overview\n\nThe [tkVFD module](https://github.com/andrewdget/tkVFD) allows for easy inclusion of customizable segmented alpha-numeric displays into any [Tkinter](https://docs.python.org/3/library/tkinter.html) application and supports both 16-segment and 7-segment geometries.\n\nThe displays generated by tkVFD are styled after \"Vacuum Fluorescent Displays\" or VFDs, a beautiful cathodoluminescent predecessor to the modern LCD digital/alpha-numeric displays *(though the tkVFD package can also simulate the look of backlit LCD displays by not displaying the distinctive \"mesh control grid\" unique to VFDs)*. See [Background](https://github.com/andrewdget/tkVFD/tree/main#background) section for more.\n\n### 16-Segment Display Example\n <p align='center'>\n\t<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg16_example.png?raw=true' width='850' height='auto'><br>\n\t<b>Common 16-segment ASCII Characters</b><br><br>\n\t<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg16_color_example.png?raw=true' alt='Example of 16-segment Display Color Customization' width='850' height='auto'>\n\t<b>Example of 16-segment Display Color Customization</b>\n</p>\n\n### 7-Segment Display Example\n <p align='center'>\n\t<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg7_example.png?raw=true' alt='Common 7-segment ASCII Characters' width='850' height='auto'>\n\t<b>Common 7-segment ASCII Characters</b><br><br>\n\t<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg7_color_example.png?raw=true' alt='Example of 7-segment Display Color Customization' width='850' height='auto'>\n\t<b>Example of 7-segment Display Color Customization</b>\n</p>\n\n## Installation\n\nInstall tkVFD with **pip**:\n\n```\npython3 -m pip install --upgrade pip\npython3 -m pip install tkVFD\n```\n\n## Usage\n\n### 16-Segment Displays\n\t\nclass **```tkVFD.seg16(parent, *option=value):```**<br>\nTkitner-compatible 16-segment \"VFD/LCD like\" display that can be used everywhere Tkinter expects a canvas object.\n\t\t\t\nOPTIONS:<br>\n**parent** - Parent Tkinter object.\n\t\t\t\t\t\n**width** - Display width in pixels. *Note: If only one display dimension parameter is passed (i.e. width but not height or vice versa) the unspecified dimension parameter is adjusted automatically to preserve default aspect ratio.*\n\t\t\t\t\t\n**height** - Display height in pixels. *Note: If only one display dimension parameter is passed (i.e. height but not width or vice versa) the unspecified dimension parameter is adjusted automatically to preserve default aspect ratio.*\n\t\t\t\t\t\n**on_color** - The color of the display segments which are \"switched on\" as expressed as an RGB row vector i.e ```[red, green, blue]``` where each color is represented as a number between 0 and 255 *(default: ```on_color=[204, 246, 250]```).*\n\t\t\t\t\t\n**off_color** - The color of the display segments which are \"switched off\" as expressed as an RGB row vector i.e. ```[red, green, blue]``` where each color is represented as a number between 0 and 255 *(default: ```off_color=[32, 32, 32]```).*\n\n**bg** - Background color of the display canvas, accepts all standard Tkinter color inputs, including standard color names and 4/8/12 bit hexadecimal RGB color formats *(default: ```bg='black'```).*\n\n**use_DP** - If ```True``` the display will include a decimal point segment *(default: ```use_DP=False```).*\n\n**use_CC** - If ```True``` the display will include colon segments *(default: ```use_CC=False```).*\n\n**use_Grid** - If ```False``` the display will not include a visual \"grid\" making the display look more \"LCD like\" *(default: ```use_Grid=True```).*\n\t\t\t\t\t\nmethod **```.control(switches, *option=value)```**<br>\nThis method is used to directly control which segments of the display are \"switched on\" or \"off\".\n\n>[!IMPORTANT]\n>If neither this method or the ```.char()``` method are used the display will exist internally, but it will not be visible in the Tkinter application as the state (i.e. on or off) of the display's segment will be indeterminate.\n\t\t\t\t\t\nOPTIONS:<br>\n**switches** - A row vector with 16 elements, each describing the binary state (i.e. ```1=on```, ```0=off```) of the corresponding segment of the display in alphabetical order from A-M (and applicable sub-segments) according to the diagram below. *Note: Control over decimal point and/or colon segments is handled separately via the options below.*\n\n<p align='center'>\n\t<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg16_map.png?raw=true' alt='Map of segment names for a 16-Segment display, including decimal point (DP) and colon (CC) segments.' width='auto' height='300'>\n</p>\n\t\t\t\t\t\t\t\n**DP** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the decimal point segment, assuming the decimal point segment was enabled when the display was initialized (i.e. ```tkVFD.seg16(parent, use_DP=True)```).\n\n**CC** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the colon segments, assuming the colon segments were enabled when the display was initialized (i.e. ```tkVFD.seg16(parent, use_CC=True)```.\n\t\t\t\t\t\t\t\nmethod **```.char(char, option=value)```**<br>\n\nThis method is used to automatically display alpha-numeric characters. Alpha-numeric characters supported by ```.seg16()``` are A-Z (capital and lower-case) and 0-9 (see [Background](https://github.com/andrewdget/tkVFD/tree/main#background) section for more).\n\n>[!IMPORTANT]\n>If neither this method or the ```.control()``` method are used the display will exist internally, but it will not be visible in the Tkinter application as the state (i.e. on or off) of the display's segment will be indeterminate.\n\t\t\t\t\t\nOPTIONS:\n**char** - A single alpha-numeric string character (i.e. ```'A'``` or ```'9'```), see above for supported characters.\n\t\t\t\t\t\t\t\n**DP** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the decimal point segment, assuming the decimal point segment was enabled when the display was initialized (i.e. ```tkVFD.seg16(parent, use_DP=True)```).\n\t\t\t\t\t\t\t\n**CC** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the colon segments, assuming the colon segments were enabled when the display was initialized (i.e. ```tkVFD.seg16(parent, use_CC=True)```.\n\nmethod **```.clear()```**<br>\nThis method resets the state of the display after being set and must be called before either ```.control()``` or ```.char()``` can used again on an existing display.\n\n>[!IMPORTANT]\n>In order to update an existing display the ```.clear()``` method must be called before either ```.control()``` or ```.char()``` can used again.\n\nExample:\n\n```\nimport tkinter as tk\nimport tkVFD\nimport time\n\ndef change2nine():\n\t'''example function for resetting and updating tkVFD displays'''\n\n\t# reset display states so they can be updated\n\tleft_disp.clear()\n\tright_disp.clear()\n\n\t# update the displays, via both methods, to show the number \"9\"\n\tleft_disp.control([1,1,1,1,0,1,1], DP=0, CC=None).pack(side=tk.LEFT)\n\tright_disp.char('9', DP=None, CC=0).pack(side=tk.LEFT)\n\nroot=tk.Tk()\nroot.title('7-Segment Display Example')\n\n# initialize an example displays\nleft_disp = tkVFD.seg7(root, height=200, use_DP=True)\n\nright_disp = tkVFD.seg7(root, height=200, use_CC=True)\n\n# disp the number \"3\" via direct control & using .pack layout management method\nleft_disp.control([1,1,1,1,0,0,1], DP=1, CC=None)\nleft_disp.pack(side=tk.LEFT)\n\n# disp the number \"3\" via 'char' shortcut\nright_disp.char('3', DP=None, CC=1)\nright_disp.pack(side=tk.LEFT)\n\n# after 5 seconds, call function to change display to \"9\"s\nroot.after(5000, change2nine)\n\nroot.mainloop()\n```\n\n### 7-Segment Displays\n\nclass **```tkVFD.seg7(parent, option=value):```**<br>\nTkitner-compatible 7-segment \"VFD/LCD like\" display that can be used everywhere Tkinter expects a canvas object.\n\nOPTIONS:<br>\n**parent** - Parent Tkinter object.\n\n**width** - Display width in pixels. *Note: If only one display dimension parameter is passed (i.e. width but not height or vice versa) the unspecified dimension parameter is adjusted automatically to preserve default aspect ratio.*\n\n\n**height** - Display height in pixels. *Note: If only one display dimension parameter is passed (i.e. height but not width or vice versa) the unspecified dimension parameter is adjusted automatically to preserve default aspect ratio.*\n\n**on_color** - The color of the display segments which are \"switched on\" as expressed as an RGB row vector i.e ```[red, green, blue]``` where each color is represented as a number between 0 and 255 *(default: ```on_color=[204, 246, 250]```)*.\n\n**off_color** - The color of the display segments which are \"switched off\" as expressed as an RGB row vector i.e. ```[red, green, blue]``` where each color is represented as a number between 0 and 255 *(default: ```off_color=[32, 32, 32]```)*.\n\n**bg** - Background color of display canvas, accepts all standard Tkinter color inputs, including standard color names and 4/8/12 bit hexadecimal RGB color formats *(default: ```bg='black'```)*.\n\n**use_DP** - If ```True``` the display will include a decimal point segment *(default: ```use_DP=False```)*.\n\n**use_CC** - If ```True``` the display will include colon segments *(default: ```use_CC=False```)*.\n\n**use_Grid** - If ```False``` the display will not include a visual \"grid\" making the display look more \"LCD like\" *(default: ```use_Grid=True```)*.\n\nmethod **```.control(switches, option=value)```**<br>\nThis method is used to directly control which segments of the display are \"switched on\" or \"off\".\n\n>[!IMPORTANT]\n>If neither this method or the ```.char()``` method are used the display will exist internally, but it will not be visible in the Tkinter application as the state (i.e. on or off) of the display's segment will be indeterminate.\n\nOPTIONS:<br>\n**switches** - A row vector with 7 elements, each describing the binary state (i.e. ```1=on```, ```0=off```) of the corresponding segment of the display in alphabetical order from A-G according to the diagram below. *Note: Control over decimal point and/or colon segments is handled separately via the options below.*\n\n<p align='center'>\n\t<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg7_map.png?raw=true' alt='Map of segment names for a 7-Segment display, including decimal point (DP) and colon (CC) segments.' width='auto' height='300'>\n</p>\n\n**DP<** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the decimal point segment, assuming the decimal point segment was enabled when the display was initialized (i.e. ```tkVFD.seg7(parent, use_DP=True)```).\n\n**CC** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the colon segments, assuming the colon segments were enabled when the display was initialized (i.e. ```tkVFD.seg7(parent, use_CC=True)```.\n\nmethod **```.char(char, option=value)```**<br>\n\nThis method is used to automatically display common alpha-numeric characters. Alpha-numeric characters supported by ```.seg7()``` are capital A-Z and 0-9. *Note: 7-Segment displays are best suited for numeral-only displays. For displays required to represent alphabetical characters, 16-Segment display are recommended. (see [Background](https://github.com/andrewdget/tkVFD/tree/main#background) section for more)*\n\n>[!IMPORTANT]\n>If neither this method or the ```.control()``` method are used the display will exist internally, but it will not be visible in the Tkinter application as the state (i.e. on or off) of the display's segment will be indeterminate.\n\nOPTIONS:<br>\n**char** - A single alpha-numeric string character (i.e. ```'A'``` or ```'9'```), see above for supported characters.\n\n**DP** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the decimal point segment, assuming the decimal point segment was enabled when the display was initialized (i.e. ```tkVFD.seg7(parent, use_DP=True)```.\n\n**CC** - Sets the binary state (i.e. ```1=on```, ```0=off```) of the colon segments, assuming the colon segments were enabled when the display was initialized (i.e. ```tkVFD.seg7(parent, use_CC=True)```.\n\t\t\t\t\t\t\t\nmethod **```.clear()```**<br>\nThis method resets the state of the display after being set and must be called before either ```.control()``` or ```.char()``` can used again on an existing display.\n\n>[!IMPORTANT]\n>In order to update an existing display the ```.clear()``` method must be called before either ```.control()``` or ```.char()``` can used again.\n\nExample:\n\n```\nimport tkinter as tk\nimport tkVFD\nimport time\n\ndef change2h():\n\t'''example function for resetting and updating tkVFD displays'''\n\n\t# reset display states so they can be updated\n\tleft_disp.clear()\n\tright_disp.clear()\n\n\t# update the displays, via both methods, to show the letter \"H\" and \"h\", respectively\n\tleft_disp.control([0,0,1,1,0,0,1,1,1,1,0,0,0,0,0,0], DP=0, CC=None).pack(side=tk.LEFT)\n\tright_disp.char('h', DP=None, CC=0).pack(side=tk.LEFT)\n\nroot=tk.Tk()\nroot.title('7-Segment Display Example')\n\n# initialize an example displays\nleft_disp = tkVFD.seg16(root, height=200, use_DP=True)\n\nright_disp = tkVFD.seg16(root, height=200, use_CC=True)\n\n# disp the letter \"G\" via direct control & using .pack layout management method\nleft_disp.control([1,1,0,1,1,1,1,1,0,1,0,0,0,0,0,0], DP=1, CC=None)\nleft_disp.pack(side=tk.LEFT)\n\n# disp the letter \"g\" via 'char' shortcut\nright_disp.char('g', DP=None, CC=1)\nright_disp.pack(side=tk.LEFT)\n\n# after 5 seconds, call function to change display to \"H\" and \"h\", respectively\nroot.after(5000, change2h)\n\nroot.mainloop()\n```\n\n## Background\n\nA Vacuum Fluorescent Display (VFD) is a analog-digital display device once commonly used in consumer electronics.\n\n<p align='center'>\n\t<img src='https://upload.wikimedia.org/wikipedia/commons/d/d3/Vacuum_fluorescent_2.jpg' alt='Example of a VFD in a Hi-Fi Sterio System' width='auto' height='450'><sub>[1]</sub><br>\n\t<b>Example of a VFD in a Hi-Fi Sterio System</b>\n</p>\n\nVFDs function in a similar fashion to the Liquid Crystal Display (LCD) **but** operate on a very different principle; cathodoluminescense. Each tube in a VFD has a mesh control grid and phosphor-coated carbon anode that is bombarded by electrons emitted from a cathode filament. This allows VFDs to natively emit a very bright light with high contrast and can support displays with multiple elements of various colors, which LCDs can not (hence, most must come equipped with a backlight).<sub>[1]</sub>\n\nVFDs, like LCDs, come in many configurations, however, the two most common are:\n\n- **seven-segment (7-segment) displays;** As the name suggests, displays of this type are made up of seven independent segments and are best suited for numeral only displays (such as a digital clock). It is possible for these displays to represent alphabetical characters but the clarity/unambiguity is generally poor as a result of limited available segment geometries (for example the letter \"Y\"). Furthermore, it is not generally possible to differentiate between capitol/lower case characters. For applications where these limitations are problematic, 16-Segment displays offer a solution. <sub>[2]</sub>\n\n- **sixteen-segment (16-segment) displays;** As the name suggests, displays of this type are made up of 16 independent segments. 16-segment displays expand on the functionality of 7-segment displays by splitting all horizontal segments in half, adding two central-vertical segments, and four diagonal segments. These additional segments allow for significantly more clear representation of alpha-numeric characters/symbols, including capitol/lower-case letters. <sub>[3]</sub>\n\n<p align='center'>\n\t<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg7_map.png?raw=true' alt='Map of segment names for a 7-Segment display, including decimal point (DP) and colon (CC) segments.' width='auto' height='400'>\n\t<img src='https://github.com/andrewdget/tkVFD/blob/main/Resources/seg16_map.png?raw=true' alt='Map of segment names for a 16-Segment display, including decimal point (DP) and colon (CC) segments.' width='auto' height='400'><br>\n\t<b>7-segment Geometry (left), 16-segment Geometry (right)</b>\n</p>\n\n## References\n\n[1] https://en.wikipedia.org/wiki/Vacuum_fluorescent_display<br>\n[2] https://en.wikipedia.org/wiki/Seven-segment_display<br>\n[3] https://en.wikipedia.org/wiki/Sixteen-segment_display<br>\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Andrew Getman  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "The tkVFD module allows for easy inclusion of customizable segmented alpha-numeric displays into any Tkinter application and supports both 16-segment and 7-segment geometries.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/andrewdget/tkVFD",
        "Issues": "https://github.com/andrewdget/tkVFD/issues"
    },
    "split_keywords": [
        "tkinter",
        "tk",
        "vfd",
        "vacuum fluorescent display",
        "lcd",
        "liquid crystal display",
        "python",
        "display"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "76a25f6e27de5b4db5d95d7e81ce6d01b3559719c4381f0223f40cb39ab6cda2",
                "md5": "7afa1fb041c9ba9a3eed68812fd978fe",
                "sha256": "a737b2c323e7b03c754b48ae411c2983478ecfbc9fe321062556c7425a13af39"
            },
            "downloads": -1,
            "filename": "tkVFD-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7afa1fb041c9ba9a3eed68812fd978fe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 1855214,
            "upload_time": "2024-01-11T01:36:52",
            "upload_time_iso_8601": "2024-01-11T01:36:52.691685Z",
            "url": "https://files.pythonhosted.org/packages/76/a2/5f6e27de5b4db5d95d7e81ce6d01b3559719c4381f0223f40cb39ab6cda2/tkVFD-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "74b42f0af697978327bf9cf4a2f3ca59573b007a0c828c3e1f324135fe4d6ff8",
                "md5": "f1184596d81f34ea705a2000176feebc",
                "sha256": "c18e09b00a487201b628b8f11a152470909c8f8a8c205af3a0f44ba09e91dcc4"
            },
            "downloads": -1,
            "filename": "tkVFD-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f1184596d81f34ea705a2000176feebc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 1855865,
            "upload_time": "2024-01-11T01:36:57",
            "upload_time_iso_8601": "2024-01-11T01:36:57.216332Z",
            "url": "https://files.pythonhosted.org/packages/74/b4/2f0af697978327bf9cf4a2f3ca59573b007a0c828c3e1f324135fe4d6ff8/tkVFD-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-11 01:36:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "andrewdget",
    "github_project": "tkVFD",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tkvfd"
}
        
Elapsed time: 0.22464s