Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • Blog
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX

Propeller 1

  • How to pause in PASM
  • How to choose between VAR and DAT
  • WAITPEQ and WAITPNE with PASM
  • IO pin manipulation using PASM
  • Control IO pins from any cog
  • 3D Models for Parallax Products
  • Implementing Abstract Data Structures with Spin Objects
  • Making in USA - The Parallax 8 core microcontroller
  • Simultaneous pin group control
  • Programming the FLiP module over WiFi
  • Keep any value in range
  • Handy Diagnostic Heartbeat
  • Customer Code Deployment in one click

Propeller 2

  • Floating point operators in SPIN2
  • 64/96/128-Bit Unsigned Integer Math
  • 3D Models for Parallax Products
  • DEBUG Plot Layer and Crop
  • Floating point
  • Getting Started Video Tutorials
  • Using the counter for timeouts
  • asmclk and the automatic clock setter
  • Sharing variables between SPIN2 and PASM2
  • Keep any value in range
  • Determine pin state - High, Low or Floating?
View Categories
  • Home
  • Docs
  • Chips Tips
  • 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
3D Models for Parallax ProductsFloating point
Table of Contents
  • Introduction
  • Code Snippet
  • Screenshots
  • Resources

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