Javelin Stamp Manual
Version 1.1
WARRANTY
Parallax Inc. 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 Inc. 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 Inc. 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 2005 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.
BASIC Stamp, Stamps in Class, Board of Education, Boe-Bot SumoBot, SX-Key and Toddler are registered
trademarks of Parallax, Inc. If you decide to use registered trademarks of Parallax Inc. on your web page or in
printed material, you must state that "(registered trademark) is a registered trademark of Parallax Inc.” upon the first
appearance of the trademark name in each printed document or web page. HomeWork Board, Parallax, and the
Parallax logo, are trademarks of Parallax Inc. If you decide to use trademarks of Parallax Inc. on your web page or
in printed material, you must state that "(trademark) is a trademark of Parallax Inc.”, “upon the first appearance of the
trademark name in each printed document or web page. Other brand and product names are trademarks or registered
trademarks of their respective holders.
ISBN ###############
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, or any costs of recovering, reprogramming, or reproducing any data stored in or used with
Parallax products. Parallax Inc. is also not responsible for any personal damage, including that to life and health,
resulting from use of any of our products. You take full responsibility for your BASIC Stamp application, no matter
how life-threatening it may be.
INTERNET DISCUSSION LISTS
We maintain active web-based discussion forums for people interested in Parallax products. These lists are accessible
from www.parallax.com via the Support
→
Discussion Forums menu. These are the forums that we operate from our
web site:
•
•
BASIC Stamps – This list is widely utilized by engineers, hobbyists and students who share their
BASIC Stamp projects and ask questions.
Stamps in Class
®
– Created for educators and students, subscribers discuss the use of the Stamps in
Class educational program in their courses. The list provides an opportunity for both students and
educators to ask questions and get answers.
Parallax Educators –Exclusively for educators and those who contribute to the development of
Stamps in Class. Parallax created this group to obtain feedback on our curricula and to provide a
forum for educators to develop and obtain Teacher’s Guides.
Translators – The purpose of this list is to provide a conduit between Parallax and those who
translate our documentation to languages other than English. Parallax provides editable Word
documents to our translating partners and attempts to time the translations to coordinate with our
publications.
Robotics – Designed exclusively for Parallax robots, this forum is intended to be an open dialogue
for a robotics enthusiasts. Topics include assembly, source code, expansion, and manual updates.
The Boe-Bot
®
, Toddler
®
, SumoBot
®
, HexCrawler and QuadCrawler robots are discussed here.
SX Microcontrollers and SX-Key – Discussion of programming the SX microcontroller with
Parallax assembly language SX-Key
®
tools and 3rd party BASIC and C compilers.
Javelin Stamp – Discussion of application and design using the Javelin Stamp, a Parallax module
that is programmed using a subset of Sun Microsystems’ Java
®
programming language.
•
•
•
•
§
ERRATA
While great effort is made to assure the accuracy of our texts, errors may still exist. If you find an error, please let us
know by sending an email to editor@parallax.com. We continually strive to improve all of our educational materials
and documentation, and frequently revise our texts. Occasionally, an errata sheet with a list of known errors and
corrections for a given text will be posted to our web site, www.parallax.com. Please check the individual product
page’s free downloads for an errata file.
Table of Contents
PREFACE ............................................................................................................................. VII
M
ANUAL
O
RGANIZATION
.....................................................................................................
VII
J
AVA
P
ROGRAMMERS
– READ THIS ..................................................................................
VIII
BASIC S
TAMP
E
NTHUSIASTS
– READ THIS ........................................................................
IX
M
ANUAL
C
ONVENTIONS
........................................................................................................
IX
R
ESOURCES AND
T
ECHNICAL
S
UPPORT
..................................................................................
X
F
REE
D
OWNLOADS FROM WWW
.
JAVELINSTAMP
.
COM
............................................................
XI
A
CKNOWLEDGEMENTS
..........................................................................................................
XI
1: INTRODUCTION ............................................................................................................... 1
T
HE
J
AVELIN
S
TAMP AND
I
TS
F
EATURES
................................................................................ 1
P
ROGRAMMING
L
ANGUAGE
- J
AVA
TM
FOR THE
J
AVELIN
S
TAMP
............................................ 2
J
AVELIN
S
TAMP
I
NTEGRATED
D
EVELOPMENT
E
NVIRONMENT
............................................... 2
V
IRTUAL
P
ERIPHERALS
........................................................................................................... 3
Background VPs ................................................................................................................. 3
Foreground VPs ................................................................................................................. 3
H
OW THE
J
AVELIN
S
TAMP
W
ORKS
......................................................................................... 4
J
AVELIN
S
TAMP
H
ARDWARE
.................................................................................................. 5
E
QUIPMENT AND
S
YSTEM
R
EQUIREMENTS
............................................................................. 6
U
SEFUL
H
ARDWARE
............................................................................................................... 7
2: JAVELIN QUICK START ............................................................................................... 11
H
ARDWARE
S
ETUP
................................................................................................................ 11
I
NSTALLING THE
J
AVELIN
S
TAMP
IDE .................................................................................. 16
R
UNNING THE
J
AVELIN
S
TAMP
IDE
AND
L
OADING A
T
EST
P
ROGRAM
................................. 19
D
EBUGGING
E
NVIRONMENT
................................................................................................. 22
O
NLINE
H
ELP
........................................................................................................................ 26
I/O E
XAMPLE
........................................................................................................................ 27
D
ID
T
HAT
W
ORK
? – T
ROUBLE
S
HOOTING
............................................................................ 29
W
HERE TO
N
EXT
? ................................................................................................................. 32
3: BEGINNERS GUIDE TO EMBEDDED JAVA PROGRAMMING ............................ 35
T
HE
C
LASS
W
RAPPER AND
M
AIN
M
ETHOD
.......................................................................... 35
D
ECLARING
C
ONSTANTS
, V
ARIABLES
,
AND
A
RRAYS
........................................................... 36
P
ERFORMING
C
ALCULATIONS
............................................................................................... 39
M
AKING
D
ECISIONS
.............................................................................................................. 40
R
EPETITIVE
O
PERATIONS
...................................................................................................... 43
D
ISPLAYING
M
ESSAGES FROM THE
J
AVELIN
......................................................................... 47
S
ENDING
M
ESSAGES TO THE
J
AVELIN
................................................................................... 49
Javelin Stamp Manual v1.1
•
www.javelinstamp.com
•
Page i