Section Use drawing image and sound files for effects Drawing

StampPlot allows drawing of shapes and placing text on the plot. In general, the structure is: The drawing type + instruction, coordinates, parameters. For example:

@TEXT 35a, 102a, 2, (BLUE), StampPlot Rules! Drawing type

StampPlot supports 4 different types of drawing depending on what you want to produce.

Starts with @: Drawing is 'constant' and will survive a reset. Good if you want something on the plot permanently even if you reset.

Starts with Drawing is 'temporary' and will be erased with resets, or anytime the plot shifts or is refreshed.

Starts with A: Drawing is treated as a data points and will be plotted just as data is when the plot is shifted. As data, it is erased when the plot is reset. Plotting must be enabled. Starts with !: Drawing is the same as using A but the drawing is restricted to the data plotting area. Plotting must be enabled.

V Test the following in the Immediate/DEBUG window's CLI:


@TEXT 35a, 102a, 2, (BLUE), StampPlot Rules! ~FREC 10,25,30,150,(RED) *FCIR 96,125,5,(GREEN) !RECT 48,50,72,175,(BLACK)

V Now shift around the plot and compare what occurs as the plot is moved.

Why didn't the text move? The objects change position because their coordinates are based on the plot coordinates. Using absolute coordinates, you can plot using points independent of the plot scales, where lower left is 0a, 0a, and upper right is 100a, 100a.

Of course, these instructions can come from the BASIC Stamp module using debug.

V Try this using this in a PBASIC program:

'Plot and mark values of points

PAUSE 1000

'Plot and mark values of points

PAUSE 1000


CR,"!POBJ Clear",CR






"@TEXT 35a, 102a, 2, (BLUE), StampPlot Rules!"

, CR

x VAR Byte x = 100



' Plot value


' Mark data with value

using text


, DEC x,",1,(black),O "

, DEC x,CR

PAUSE 2 000


(PTIME) in the text instruction substitutes the current plot time in seconds for the X coordinate. As always, monitor in the BASIC Stamp Editor's Debug Terminal ensure the format is correct.

102.00 126.00 150.00 171.00 138.00 222.00


102.00 126.00 150.00 171.00 138.00 222.00


DIY Battery Repair

DIY Battery Repair

You can now recondition your old batteries at home and bring them back to 100 percent of their working condition. This guide will enable you to revive All NiCd batteries regardless of brand and battery volt. It will give you the required information on how to re-energize and revive your NiCd batteries through the RVD process, charging method and charging guidelines.

Get My Free Ebook

Post a comment