EasyManuals Logo

LEGO MINDSTORMS Robots User Manual

LEGO MINDSTORMS Robots
226 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #112 background imageLoading...
Page #112 background image
First, the terminal emulator needs to know how long to wait after sending each character. In HyperTerminal (in Windows 95, 98, or NT), this setting is available in the File > Properties menu
option. In the window that appears, choose the Settings tab and press the ASCII Setup button. You should set the Line delay to 100 milliseconds and the Character delay to 20 milliseconds, as
shown in Figure 6-2.
Figure 6-2.
Setting character delays for sending files
To upload a file to pbFORTH, choose Transfer Send Text File from the menu.
Page 121
There are other options, as well. Appendix B, A pbFORTH Downloader, contains source code for a Java-based program downloader. Furthermore, the pbFORTH web site has pbFORTH tools
written in Tcl/Tk.
About Forth
In this section, I'll briefly describe the Forth language itself. Then I'll detail pbFORTH's RCX-specific words and present some short examples of robotic programming with pbFORTH.
The Stack
Forth is a simple but powerful language. It is based around the idea of a stack. A stack is just what it sounds like, like a stack of trays in one of those spring-loaded carts at a cafeteria. You can add
something to the stack or remove the top item. Adding an item to the stack is a push. Retrieving the top item is a pop. A pop always returns the last item that was pushed.
Assuming you've already gotten pbFORTH running on your RCX, let's see how this works. Let's begin by pushing a number on the stack. Type a number into your terminal emulator and hit
return. pbFORTH responds with a friendly "ok":
77
ok
Now type a single period and press return. The period pops a value off the stack and prints it out to the console, along with that ubiquitous "ok":
.
77 ok
You can push multiple values on the stack by separating them with spaces. Similarly, you can pop more than one value off the stack with more than one period, like this:

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the LEGO MINDSTORMS Robots and is the answer not in the manual?

LEGO MINDSTORMS Robots Specifications

General IconGeneral
Product LineLEGO MINDSTORMS
CategoryToy
Age Range10+
Batteries RequiredYes
Memory64 MB RAM, 16 MB Flash
ConnectivityBluetooth, USB
SensorsTouch, Color, Gyro
Battery TypeAA
Interactive FeaturesProgrammable, Remote Control
App CompatibilityiOS, Android
ProcessorARM9
Pieces Count601
Battery Count6
App NameLEGO MINDSTORMS EV3 Programmer App

Related product manuals