Introduction #
PNut_v49p1 adds new DEBUG PLOT commands allowing up to 8 bitmap layers that you can selectively copy into the PLOT window. This is useful for doing photo-realistic displays, where pre-drawn images are copied into the plot window to show, say, a toggle switch being in an ON or OFF position.
Some early adopters have shared their results, tips and code examples at the Parallax Forums
Code Snippet #
This example will open a debug terminal window and demonstrate the new DEBUG Plot layer and crop features. Copy this code into PNUT, Propeller Tool or SPIN Tools IDE and load it with the DEBUG option enabled to your connected P2.
_clkfreq = 100_000_000
PUB go() | i, x, y
debug(`plot myplot size 740 500 update)
debug(`myplot layer 1 'cockpit.bmp') 'NEW
repeat
debug(`myplot clear linesize 3)
repeat 10
x := (getrnd() +// 6) << 7
y := (getrnd() +// 4) << 7
debug(`myplot crop 1 `(x, y, x+128, y+128)) 'NEW
debug(`myplot color green)
repeat i from 0 to 10
debug(`myplot set `(100 + i * 50, 100))
debug(`myplot line `(640 - i * 50, 400))
debug(`myplot update)
waitms(100)
Note: This code example uses a background image "cockpit.bmp" which is shown below, or click here to download.
Screenshots #




Resources #
Community DEBUG examples and discussion
Parallax Propeller 2 - Spin2 Language Documentation