SPPG-WritingPrograms-v1.2

SPPG-WritingPrograms-v1.2 - Writing Programs 1 Scribbler...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Writing Programs · 1 Scribbler PBASIC Programming Guide © Parallax Inc. 9/2005 v1.2 · Download Free from www.ScribblerRobot.com/Education Scribbler PBASIC Programming Guide Writing Programs Inside the Scribbler Robot is a small computer called a BASIC Stamp ® microcontroller. It performs a list of instructions that make the Scribbler operate. With the BASIC Stamp Editor, you can write your own list of instructions, called a program, and load it into the BASIC Stamp inside your Scribbler Robot. These programs are written in the PBASIC programming language. This Guide will show you how to write your first PBASIC programs for your Scribbler Robot. You will be able to communicate with the BASIC Stamp, and make the Scribbler blink its lights, generate sounds, and drive its wheel motors. With the obstacle and stall sensors, you can program the Scribbler to drive safely. To program your Scribbler Robot, you need to have the BASIC Stamp Editor software (v2.1 or higher) installed and running on your personal computer. You will need to have your Scribbler Robot connected to you computer with the serial cable. Also, you will need to have confirmed that your computer is communicating with the BASIC Stamp microcontroller inside the Scribbler Robot. If you need instructions to do these things, follow the Setting Up Guide before you begin here. INTRODUCING THE BASIC STAMP EDITOR 2 SCRIBBLER HARDWARE PROGRAMMING CONNECTIONS 8 BLINKING THE LIGHTS WITH PROGRAM LOOPS 9 CONTROLLING SOUND AND MOTION WITH OUTPUT SIGNALS 12 MAKING DECISIONS WITH SENSORS 20 PUTTING IT ALL TOGETHER 30
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 · Writing Programs Scribbler PBASIC Programming Guide © Parallax Inc. 9/2005 v1.2 · Download Free from www.ScribblerRobot.com/Education Introducing the BASIC Stamp Editor To make a program for your Scribbler, you will type a list of instructions in the main edit pane . The programs are written in PBASIC, a language that is easy for people to read and understand. The BASIC Stamp Editor translates the PBASIC program into binary numbers - a long string of ones and zeroes - that computers can understand. When you run your program, the Editor transmits it from your computer to the BASIC Stamp inside your Scribbler Robot. Writing a Program In every PBASIC program, you must include two instructions that let the BASIC Stamp Editor know what model of BASIC Stamp microcontroller you are programming, and what version of PBASIC you are using. You can use the toolbar icons to place these two instructions in your program automatically, without having to type them. Begin by clicking on the BS2 icon on the top tool bar, since the Scribbler contains a BASIC Stamp 2. This inserts “ ' {$STAMP BS2} ” into your program. Next, click on the PBASIC 2.5 icon, for language
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/06/2009 for the course CMPE 8 taught by Professor Dunbar during the Fall '08 term at UCSC.

Page1 / 36

SPPG-WritingPrograms-v1.2 - Writing Programs 1 Scribbler...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online