Using Spirit.ocx With Visual Basic; You May Already Have Visual Basic - LEGO MINDSTORMS Robots Manual

Unofficial guide
Table of Contents

Advertisement

8

Using Spirit.ocx with Visual Basic

In this chapter:
• You May Already Have
Visual Basic
• About Spirit.ocx
• Calling Spirit.ocx Functions
• Immediate and Delayed
Gratification
• Programs, Tasks, and
Subroutines
• Tips
• Retrieving the Datalog
• Online Resources
Part of the appeal of the programming environments described in Chapter 4, Not Quite C, and Chapter 6, pbFORTH, is that they don't tie you down to using Windows on your development PC.
The programming environment that comes with RIS, RCX Code, is a Windows-only solution, which is distressing to people who prefer other operating systems. Aside from providing better
capabilities than RCX Code, NQC and pbFORTH also allow you to develop RCX software using your operating system of choice.
In this chapter, I'll describe a Windows-only solution— programming your robots using Visual Basic (VB). Visual Basic is a language developed by Microsoft and included with many of their
other products. The link between Visual Basic and your robots is a file called Spirit.ocx, which is installed as part of the standard RIS software. In this chapter, I'll show you how to use Visual
Basic and Spirit.ocx to control and program your robots.
If you are running windows, chances are good that you already have Visual Basic somewhere, as I'll describe in the next section. Because VB is so widespread in the Windows world, I won't
attempt to describe the language itself. There are several good online tutorials, including information and examples at Microsoft's site. (See the "Online Resources" section at the end of this
chapter for references.) Instead, this chapter focuses on how you can use VB to write programs for your RCX.

You May Already Have Visual Basic

Visual Basic is a programming language made by Microsoft. You can purchase it as a separate product. The "Learning Edition" is $109US. A "Professional Edition,"
Page 159

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents