Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • Blog
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX
View Categories
  • Home
  • Docs
  • Propeller 2
  • DEBUG Plot Layer and Crop

DEBUG Plot Layer and Crop

Reading Time: < 1 min read

SPIN2

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 #

cockpitDownload

Community DEBUG examples and discussion

Parallax Propeller 2 - Spin2 Language Documentation

PNut/Spin2 Latest Version (v49)

Was this useful ?
Share This Article :
  • Facebook
  • X
  • LinkedIn
Still stuck? How can we help?

Still stuck? How can we help?

Updated on February 10, 2025
Table of Contents
  • Introduction
  • Code Snippet
  • Screenshots
  • Resources

Copyright © 2025 - Parallax Inc.
599 Menlo Drive | Rocklin, CA 95765 | USA