BASIC Stamp Programming Manual 2.0C · · Page 1 Contents

Total Page:16

File Type:pdf, Size:1020Kb

BASIC Stamp Programming Manual 2.0C · · Page 1 Contents BASIC Stamp Ò Programming Manual Version 2.0c Warranty Parallax warrants its products against defects in materials and workmanship for a period of 90 days. If you discover a defect, Parallax will, at its option, repair, replace, or refund the purchase price. Simply call our sales department for an RMA number, write it on the label and return the product with a description of the problem. We will return your product, or its replacement, using the same shipping method used to ship the product to Parallax (for instance, if you ship your product via overnight express, we will do the same). This warranty does not apply if the product has been modified or damaged by accident, abuse, or misuse. 14-Day Money-Back Guarantee If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This does not apply if the product has been altered or damaged. Copyrights and Trademarks Copyright © 2000 by Parallax, Inc. All rights reserved. PBASIC is a trademark and BASIC Stamp is a registered trademark or Parallax, Inc. PIC is a registered trademark of Microchip Technology, Inc. Windows is a registered trademark of Microsoft Corporation. 1-wire is a registered trademark of Dallas Semiconductor. Other brand and product names are trademarks or registered trademarks of their respective holders. Disclaimer of Liability Parallax, Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, and any costs of recovering, reprogramming, or reproducing any data stored in or used with Parallax products. Internet Access We maintain Internet systems for your convenience. These may be used to obtain software, communicate with members of Parallax, and communicate with other customers. Access information is shown below: Web: http://www.parallaxinc.com http://www.stampsinclass.com General e-mail: [email protected] Tech. e-mail: [email protected] Internet BASIC Stamp Discussion List We maintain a BASIC Stamp discussion list for people interested in BASIC Stamps. Many people subscribe to the list, and all questions and answers to the list are distributed to all subscribers. It’s a fun, fast, and free way to discuss BASIC Stamp issues. To subscribe to the BASIC Stamps list, visit the Tech Support section of the Parallax, Inc website. This manual is valid with the following software and firmware versions: BASIC Stamp 1: BASIC Stamp 2sx: STAMP.EXE software version 2.1 STAMP2SX.EXE software version 1.0 Firmware version 1.4 STAMPW.EXE software version 1.096 Firmware version 1.0 BASIC Stamp 2: STAMP2.EXE software version 1.1 BASIC Stamp 2p: STAMPW.EXE software version 1.096 STAMP2P.EXE software version 1.6 Firmware version 1.0 STAMPW.EXE software version 1.098 Firmware version 1.1 BASIC Stamp 2e: STAMP2E.EXE software version 1.0 STAMPW.EXE software version 1.096 Firmware version 1.0 The information herein will usually apply to newer versions but may not apply to older versions. New software can be obtained free on our ftp and web site (ftp.parallaxinc.com, www.parallaxinc.com). If you have any questions about what you need to upgrade your product, please contact Parallax. Contents PREFIX ........................................................................................................5 INTRODUCTION TO THE BASIC STAMP.........................................................7 BASIC STAMP 1 HARDWARE .........................................................................................8 BASIC STAMP 2 HARDWARE .......................................................................................10 BASIC STAMP 2E HARDWARE .....................................................................................12 BASIC STAMP 2SX HARDWARE...................................................................................14 BASIC STAMP 2P HARDWARE .....................................................................................16 DEVELOPMENT BOARDS ...............................................................................................18 BASIC Stamp 1 Carrier Board ..............................................................................18 BASIC Stamp 2 Carrier Board ..............................................................................19 BASIC Stamp Super Carrier Board......................................................................20 Board of Education .................................................................................................22 BASIC Stamp Activity Board .................................................................................23 GUIDELINES AND PRECAUTIONS...................................................................................25 QUICK START GUIDE.................................................................................29 USING THE BASIC STAMP EDITOR .............................................................33 BASIC STAMP WINDOWS EDITOR ...............................................................................34 BASIC STAMP DOS EDITOR .......................................................................................41 BASIC STAMP ARCHITECTURE...................................................................45 RAM ORGANIZATION (BS1) .........................................................................................45 RAM ORGANIZATION (BS2, BS2E, BS2SX, BS2P) ...................................................46 DEFINING AND USING VARIABLES.................................................................................48 The Rules of Symbol Names ................................................................................49 Defining Array Variables ........................................................................................51 Aliases and Variable Modifiers..............................................................................53 CONSTANTS AND COMPILE-TIME EXPRESSIONS .........................................................56 NUMBER REPRESENTATIONS .......................................................................................59 ORDER OF OPERATIONS...............................................................................................60 INTEGER MATH RULES..................................................................................................62 UNARY OPERATORS......................................................................................................63 Absolute Value (ABS).............................................................................................64 Cosine (COS) ..........................................................................................................64 Decoder (DCD)........................................................................................................64 BASIC Stamp Programming Manual 2.0c · www.parallaxinc.com · Page 1 Contents Inverse (~)................................................................................................................64 Negative (-)..............................................................................................................64 Encoder (NCD)........................................................................................................65 Sine (SIN) ................................................................................................................65 Square Root (SQR) ................................................................................................66 BINARY OPERATORS.....................................................................................................66 Add (+)......................................................................................................................67 Subtract (-)...............................................................................................................67 Multiply (*)................................................................................................................67 Multiply High (**) .....................................................................................................68 Multiply Middle (*/) ..................................................................................................68 Divide (/)...................................................................................................................69 Modulus (//)..............................................................................................................70 Minimum (MIN)........................................................................................................70 Maximum (MAX) .....................................................................................................71 Digit (DIG)................................................................................................................72 Shift Left (<<)...........................................................................................................72 Shift Right (>>)........................................................................................................72 Reverse (REV) ........................................................................................................73 And (&) .....................................................................................................................73
Recommended publications
  • The Parallax 2004 Fall Product Guide Is Brought to You by Parallax, Inc
    www.parallax.com The Parallax 2004 Fall Product Guide is brought to you by Parallax, Inc. and our network of 70+ distributors. This product guide is unique from all of our previous guides since the pricing is not published next to the Parallax part number and product description. Parallax, Inc. 599 Menlo Drive, #100 For pricing information, please visit your Rocklin, CA 95765, USA distributor’s web site or view the included price list (may not be applicable). Telephone: Office/Sales/Support: (916) 624-8333 The following 30 pages focus on Parallax’s Fax: (916) 624-8003 core products, including those which are most often carried by distributors. This includes Callers in the United States only: but is not limited to the following: BASIC Toll-Free Sales: 888-512-1024 Stamp microcontrollers, Programming Boards, Toll-Free Technical Support: 888-99-STAMP Starter Kits, Application Modules, Accessories, Robotics, Motor Control, Education Stamps Please Note: Sales Department, Technical in Class, Industrial, SX-Key Programming Support, and General Office hours are Monday Tools and Chips, Altera FPGA Development through Friday from 7:00 a.m. to 5:00 p.m., Tools. Additional accessories and components Pacific Standard Time. may be available from your distributor or www.parallax.com. Internet: www.parallax.com Our distributors are very responsive to customer requests and are able to procure E-mail: Parallax products that are available from our [email protected] web site. For international customers, this is [email protected] of extreme importance since distributors use [email protected] their expertise to provide you with the best pricing available after paying for overseas BASIC Stamp, Board of Education, Stamps shipping charges, duties, and taxes.
    [Show full text]
  • Drive Motor and Encoder
    ARobot Mobile Robot For Hobbyist, Research and Education Assembly and User Guide Copyright (c) 2005 Arrick Robotics All Rights Reserved Robotics.com ARobot Mobile Robot Revision D 11/17/2005 Table of Contents Introduction Introduction....................................................1 About ARobot................................................1 What You’ll Need..........................................2 Feature List ....................................................2 Specifications.................................................3 Precautions.....................................................4 Component Locator .......................................5 Glossary of Terms..........................................6 Assembly Assembly Overview.......................................9 Parts................................................................10 Painting ..........................................................13 Whiskers ........................................................14 Drive Motor and Brackets..............................16 Encoder Sensor ..............................................17 Front Wheel Assembly ..................................18 Steering Motor and Rear Wheels...................19 Controller Board ............................................21 Battery Pack...................................................22 Body Cable.....................................................23 Finishing Up...................................................24 Usage About the Controller ......................................25
    [Show full text]
  • Optore-16 Optore-16 Standard Standard
    OPTORE-16 OPTORE-16 STANDARD STANDARD EDV-Nr.: A-1222 EDV-No.: A-1222 16 Isolated Digital Inputs 16 Isolated Digital Inputs 16 Reedrelay Outputs 16 Reedrelay Outputs wasco® wasco® user‘s guide user‘s guide wasco® wasco® Copyright© 2006 by Messcomp Datentechnik GmbH Copyright© 2006 by Messcomp Datentechnik GmbH This documentation and the software included with this product are This documentation and the software included with this product are copyright by Messcomp Datentechnik GmbH. All rights are reserved. copyright by Messcomp Datentechnik GmbH. All rights are reserved. Messcomp Datentechnik GmbH reserves the right to modify the products Messcomp Datentechnik GmbH reserves the right to modify the products described in this manual at any time without notice. described in this manual at any time without notice. No parts of this manual are allowed to be reproduced, copied, trans- No parts of this manual are allowed to be reproduced, copied, trans- lated or transmitted in any way without a prior written authorization of lated or transmitted in any way without a prior written authorization of Messcomp Datentechnik GmbH. Messcomp Datentechnik GmbH. Trademarks Trademarks IBM PC, PC/XT and PC/AT are registered trademarks of International IBM PC, PC/XT and PC/AT are registered trademarks of International Business Machines (IBM). Business Machines (IBM). BASIC is registered trademark of Dartmouth College. BASIC is registered trademark of Dartmouth College. Turbo Pascal, Turbo C are registered trademarks of Borland. Turbo Pascal, Turbo C are registered trademarks of Borland. Quickbasic is registered trademark of Microsoft. Quickbasic is registered trademark of Microsoft. Powerbasic is registered trademark of Robert S.
    [Show full text]
  • What's a Microcontroller?
    What’s a Microcontroller? Student Guide VERSION 3.0 Page 2 · What’s a Microcontroller? WARRANTY Parallax warrants its products against defects in materials and workmanship for a period of 90 days from receipt of product. If you discover a defect, Parallax will, at its option, repair or replace the merchandise, or refund the purchase price. Before returning the product to Parallax, call for a Return Merchandise Authorization (RMA) number. Write the RMA number on the outside of the box used to return the merchandise to Parallax. Please enclose the following along with the returned merchandise: your name, telephone number, shipping address, and a description of the problem. Parallax will return your product or its replacement using the same shipping method used to ship the product to Parallax. 14-DAY MONEY BACK GUARANTEE If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a full refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This guarantee is void if the product has been altered or damaged. See the Warranty section above for instructions on returning a product to Parallax. COPYRIGHTS AND TRADEMARKS This documentation is Copyright 2003-2009 by Parallax Inc. By downloading or obtaining a printed copy of this documentation or software you agree that it is to be used exclusively with Parallax products. Any other uses are not permitted and may represent a violation of Parallax copyrights, legally punishable according to Federal copyright or intellectual property laws. Any duplication of this documentation for commercial uses is expressly prohibited by Parallax Inc.
    [Show full text]
  • BASIC Stamp Programming Manual Version 1.9
    ® BASIC Stamp Programming Manual Version 1.9 ® Warranty Parallax warrants its products against defects in materials and workmanship for a period of 90 days. If you discover a defect, Parallax will, at its option, repair, replace, or refund the purchase price. Simply return the product with a description of the problem and a copy of your invoice (if you do not have your invoice, please include your name and telephone number). We will return your product, or its replacement, using the same shipping method used to ship the product to Parallax (for instance, if you ship your product via overnight express, we will do the same). This warranty does not apply if the product has been modified or damaged by accident, abuse, or misuse. 14-Day Money-Back Guarantee If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This does not apply if the product has been altered or damaged. Copyrights and Trademarks Copyright © 1998 by Parallax, Inc. All rights reserved. PBASIC is a trademark and Parallax, the Parallax logo, and BASIC Stamp are registered trademarks of Parallax, Inc. PIC is a registered trademark of Microchip Technology, Inc. Other brand and product names are trademarks or registered trademarks of their respective holders. Disclaimer of Liability Parallax, Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, and any costs or recovering, reprogramming, or reproducing any data stored in or used with Parallax products.
    [Show full text]
  • Earth Measurements Student Guide for Experiments #1 Through #6
    Earth Measurements Student Guide for Experiments #1 through #6 Version 1.2 Warranty Parallax warrants its products against defects in materials and workmanship for a period of 90 days. If you discover a defect, Parallax will, at its option, repair, replace, or refund the purchase price. Simply call for a Return Merchandise Authorization (RMA) number, write the number on the outside of the box and send it back to Parallax. Please include your name, telephone number, shipping address, and a description of the problem. We will return your product, or its replacement, using the same shipping method used to ship the product to Parallax. 14-Day Money Back Guarantee If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a full refund. Parallax will refund the purchase price of the product, excluding shipping / handling costs. This does not apply if the product has been altered or damaged. Copyrights and Trademarks This documentation is copyright 1999 by Parallax, Inc. BASIC Stamp is a registered trademark of Parallax, Inc. If you decided to use the name BASIC Stamp on your web page or in printed material, you must state that "BASIC Stamp is a registered trademark of Parallax, Inc." Other brand and product names are trademarks or registered trademarks of their respective holders. Disclaimer of Liability Parallax, Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, and any costs or recovering, reprogramming, or reproducing any data stored in or used with Parallax products.
    [Show full text]
  • BASIC Stamp I: STAMP.EXE Software Version 2.0 Firmware Version 1.4
    ® BASIC Stamp Programming Manual Version 1.8 ® This manual is valid with the following software and firmware versions: BASIC Stamp I: STAMP.EXE software version 2.0 Firmware version 1.4 BASIC Stamp II: STAMP2.EXE software version 1.1 Firmware version 1.0 Newer versions will usually work, but older versions may not. New software can be obtained for free on our BBS and Internet web and ftp site. New firmware, however, must usually be purchased in the form of a new BASIC Stamp. If you have any questions about what you may need, please contact Parallax. Introduction Thank you for purchasing a BASIC Stamp product. We’ve been making BASIC Stamp computers for years, and most customers find them useful and fun. Of course, we hope your experience with BASIC Stamps will be useful and fun, as well. If you have any questions or need technical assistance, please don’t hesitate to contact Parallax or the distributor from which you purchased your BASIC Stamps. This manual is divided into two sections. The first section deals with the BASIC Stamp I, and the second section deals with the BASIC Stamp II. The BASIC Stamp I has been around for some time, and therefore has more data in the way of application notes. If you have prior experience with BASIC Stamp I, you should consult Appendix C, for details on converting to the Basic Stamp II. PBASIC Language: the BASIC Stamps are programmed in a simple version of the BASIC language, called PBASIC. We developed PBASIC to be easy to understand, yet well-suited for the many control and monitoring applications that BASIC Stamps are used in.
    [Show full text]
  • Embedded Solutions
    EMBEDDED SOLUTIONS Wireless Solutions Boundary Devices . .49 Ackme Networks . 5 Digi International . 51, 52 Anaren . 7, 8 Digilent . .53 Antenova . 5 DLP Design . 54, 55 AMS . .6 EasySync. .56 Bluegiga . 9 FTDI . 57, 58 Digi International . 10, 11 Gravitech . .59 DLP Design . .12 Intel. 50, 60 Freescale. .13 Lantronix . 61, 62 Fujitsu . .13 Leopard Imaging . .48 IDT . 6 Microchip . .50 Laird Technologies . 14, 15 Mide . 63 Linx. 16, 17, 18, 19 MikroElektronika . 64 LS Research . .20 Minnowboard. .48 Maestro Wireless. 6 NetBurner . 65 Micrel. 21, 22 Netduino . 49 Microchip . 23, 24 Pandaboard . .48 Murata Wireless . 25, 26 Parallax. .66 Nordic Semiconductor . 27 Powercast . 50 NXP . 28 Rabbit Semiconductor . 67, 68 Phoenix Contact . 29 Silex . 50 Redpine Signals . 30 Taoglas. 69, 70, 71 RF Digital. .31 Terasic . .72 Silicon Labs . 32, 33 Texas Instruments . .50 Skyetek. .34 STMicroelectronics. .35 Data Acquisition Texas Instruments . 36, 37, 38 Adlink. .73 Wiznet . .39 Advantech . 74, 75, 76, 77 Wurth. .13 Single Board Computers Chipsets Adlink. .78 Intel. .40 Advantech . 79 Arbor . 80 Embedded Modules Axiomtek . 81 Adlink. 41, 42 Congatec . .82 Advantech . 43, 44, 45 Critical Link. .82 Arduino . .46 iBase . 83, 84 B&B Electronics . 47 KA-RO . .85 Beagleboard . .48 Rabbit Semiconductors . 86, 87 WiFi Modules and Chip Antennas Wireless Solutions WALLABY WICED WI-FI NETWORKING MODULES ACKme Networks AMW004 Wallaby WICED Wi-Fi Networking Module is a fully certified small form factor, low power WICED-based Wi-Fi networking module perfectly suited to deeply embedded applications for medium to high volumes. The module runs an embedded TCP/IP networking stack with SSL/TLS/HTTPS security and includes an onboard PCB trace antenna and u.FL connector all in a physical footprint of just 31.2mm x 17.8mm (1.25" x 0.7").
    [Show full text]
  • The Elements of PBASIC Style
    599 Menlo Drive, Suite 100 General: [email protected] Rocklin, California 95765, USA Technical: [email protected] Office: (916) 624-8333 Web Site: www.parallax.com Fax: (916) 624-8003 Educational: www.stampsinclass.com The Elements of PBASIC Style Introduction Like most versions of the BASIC programming language, PBASIC is very forgiving and the compiler enforces no particular formatting style. As long as the source code is syntactically correct, it will compile and download to the BASIC Stamp without trouble. Why, then, would one suggest a specific style for PBASIC? Consider this: Over two million BASIC Stamps have been sold and there are nearly 2500 members of the BASIC Stamp mailing list (on Yahoo! Groups). This makes it highly likely that you'll be sharing your PBASIC code with someone, if not co-developing a BASIC Stamp project. Writing code in an organized, predictable manner will save you – and your potential colleagues – a lot of time; in analysis, in troubleshooting and especially when you return to a project after a long break. The style guidelines presented here are just that: guidelines. They have been developed from style guidelines used by professional programmers using other high-level languages such as Visual Basic®, C/C++, and Java™. Use these guidelines as-is, or modify them to suit your individual needs. The key is selecting a style the works well for you or your organization, and then sticking with it. PBASIC Style Guidelines 1. Do It Right the First Time Many programmers, especially new ones, fall into the "I'll knock it out now and fix it later." trap.
    [Show full text]
  • BASIC Stamp Programming Manual 2.0C · · Page 1 Contents
    BASIC Stamp Ò Programming Manual Version 2.0c Warranty Parallax warrants its products against defects in materials and workmanship for a period of 90 days. If you discover a defect, Parallax will, at its option, repair, replace, or refund the purchase price. Simply call our sales department for an RMA number, write it on the label and return the product with a description of the problem. We will return your product, or its replacement, using the same shipping method used to ship the product to Parallax (for instance, if you ship your product via overnight express, we will do the same). This warranty does not apply if the product has been modified or damaged by accident, abuse, or misuse. 14-Day Money-Back Guarantee If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This does not apply if the product has been altered or damaged. Copyrights and Trademarks Copyright © 2000 by Parallax, Inc. All rights reserved. PBASIC is a trademark and BASIC Stamp is a registered trademark or Parallax, Inc. PIC is a registered trademark of Microchip Technology, Inc. Windows is a registered trademark of Microsoft Corporation. 1-wire is a registered trademark of Dallas Semiconductor. Other brand and product names are trademarks or registered trademarks of their respective holders. Disclaimer of Liability Parallax, Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, and any costs of recovering, reprogramming, or reproducing any data stored in or used with Parallax products.
    [Show full text]
  • Robotics with the Boe-Bot Student Guide
    Robotics with the Boe-Bot Student Guide VERSION 3.0 WARRANTY Parallax warrants its products against defects in materials and workmanship for a period of 90 days from receipt of product. If you discover a defect, Parallax will, at its option, repair or replace the merchandise, or refund the purchase price. Before returning the product to Parallax, call for a Return Merchandise Authorization (RMA) number. Write the RMA number on the outside of the box used to return the merchandise to Parallax. Please enclose the following along with the returned merchandise: your name, telephone number, shipping address, and a description of the problem. Parallax will return your product or its replacement using the same shipping method used to ship the product to Parallax. 14-DAY MONEY BACK GUARANTEE If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a full refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This guarantee is void if the product has been altered or damaged. See the Warranty section above for instructions on returning a product to Parallax. COPYRIGHTS AND TRADEMARKS This documentation is Copyright 2003-2010 by Parallax Inc. By downloading or obtaining a printed copy of this documentation or software you agree that it is to be used exclusively with Parallax microcontrollers and products. Any other uses are not permitted and may represent a violation of Parallax copyrights, legally punishable according to Federal copyright or intellectual property laws. Any duplication of this documentation for commercial uses is expressly prohibited by Parallax Inc.
    [Show full text]
  • Physics 517/617 - Experiment 6B Microcomputers
    Physics 517/617 - Experiment 6B Microcomputers Since the Intel 8080 was introduced in 1974 the microprocessor has taken over our lives in many ways. They control hardware from home bread machines to automatic water faucets at airports. A modern car is estimated to have more than thirty monitoring and controlling car functions at all times. Microprocessors are circuit elements that fall between electronic hardware and software. They are computers in that they are programmed using algorithmic languages, but they are hardware in that they are installed by being wired into the system with all of the other electronic components The Basic Stamp II (BS2) is a complete microprocessor (cpu,eeprom,clock...) manufactured by Parallax. Built around the PIC16C57C processor, it is the standard microprocessor used by amateurs and professionals around the U.S.. Parallax simplified the programming by incorporating a basic interpreter in the PIC16C57C rom. The interpreter reads basic commands from an eprom on the StampII. The PIC16C57C has 14 multipurpose programmable input/output pins. The Stamp II is slow (~3000 basic commands/second) but is extremely easy to use. It is programmed through a serial port cable, which can also be used for DAQ. A user-friendly PBASIC compiler/editor/loader is freely available on the Parallax web site. 1) Digital Output: How to get started. An interactive tutorial on your computer (or if you are at home you can install it from the CDROM provided. On the desktop, click on the basic stamp folder. Then click on BS2_Tutorial. You should do the exercises in 3: BASIC Stamp Editor, and 4: Input, Processing, and Output (Here skip the sections on Analog Input: RCTIME and Frequency Output: FREQOUT.
    [Show full text]