Subject:
|
Re: OO programing in RCX
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Wed, 12 Jan 2000 07:25:20 GMT
|
Viewed:
|
1704 times
|
| |
| |
Thank you, David. Your gode is great! I learned a lot from your quick example,
though I prefer Java more. I will encapsulate RCX commands in some utility
objects and use them in more higher level objects.
What I focus now is make a RF/IR adapter to eliminate the direction limitation
of IR. If I make it, I can build my whole OO environment on my desttop and
directly command the RCX. It's interesting!
Eric OO,2 :)
In lugnet.robotics.rcx, David Leeper writes:
> Hi Eric,
>
> Yes, I believe you could create a sensor object on the VB side and write your
> code thinking in terms of a sensor object. Here's one way:
<snip>
> Now this code is simplified, you'd need to add a calibration routine to handle
> different lighting, and so on. But it gets the idea across.
>
> Yet another advantage to the object-oriented method is you can encapsulate
> specialized knowledge of you code in the class, freeing the programmer from
> having to learn, remember, and use that knowledge. For example, in my
> SoftBricks prototype I made four mapping functions RCX subroutines. This was
> because they were too large to use as inline code. Now if you're not using
> mapping, you can rip those subroutines out because you won't need them. This
> saves a significant amount of RCX program memory. But the programmer has too
> KNOW they can be ripped out, know what subroutines to rip out, and remember to
> put them back in the right place if he later adds mapping. With the OO method,
> all that knowledge is in the mapping classes, so if you're not using mapping,
> those subroutines are not loaded to the RCX. If you later add mapping, those
> subroutines get loaded. It makes the library easier to use, smaller on the RCX
> side, and removes a big potential for coding errors.
>
> David Leeper (likes OO)
>
|
|
Message is in Reply To:
| | Re: OO programing in RCX
|
| Hi Eric, Yes, I believe you could create a sensor object on the VB side and write your code thinking in terms of a sensor object. Here's one way: =-=-=-= BEGIN SAMPLE CODE =-=-=-= Private m_SensorNumber As Integer Private m_SensorType As Integer (...) (25 years ago, 11-Jan-00, to lugnet.robotics.rcx)
|
14 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|