Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 2.24 KB

File metadata and controls

60 lines (39 loc) · 2.24 KB

Python BT82x Development Simple Plotting Example

Back

Simple Plotting Example

The plottest.py and plottest2.py examples demonstrate drawing a graph using the ext-plotgraph extension.

The program plottest.py draws the graphs directly to the screen, whereas the plottest2.py code will render the graphs into a bitmap in RAM_G then display the bitmap afterwards.

The second program is useful for cases where an image may be rendered ahead of time by the BT82x and stored in RAM_G until it is required. This can save a lot of time if bitmap (or any other combinations of display list output) is static and can therefore be drawn once and used mulitple times. the CMD_RENDERTARGET is changed to draw the bitmap and then reverted to the original values when the graphs have been drawn into RAM_G.

Extension

The ext-plotgraph extension is loaded with the extplotmem code. This loads the cmd_plotdraw function into the device. To verify the version of the extension loaded and the components the function the loader code for the extplotmem returns a string containing information on the extension code. This is printed on the console when the extension is loaded:

print(extplotmem.loadpatch(eve))

The return message is as follows:

plot6;plot-0.3;mem-0.1;

The name of the extension code is "plot6", it contains the ext-plotgraph extension version "0.3" and the ext-memory extension "0.1".

Segment Example

Running the Example

The format of the command call to run plottest is as follows:

MPSSE example:

python plottest.py --connector ft232h 

FT4222 example in single mode (--mode 0):

python plottest.py --connector ft4222module 

FT4222 example in dual mode (--mode 1) or quad mode (--mode 2):

python plottest.py --connector ft4222module --mode 2

Files and Folders

The example contains a single file which comprises all the demo functionality.

File/Folder Description
plottest.py Example source code file
plottest2.py Example source code file
extplotmem.py Snippet source code for memory and graph plotting extension
docs Documentation support files