 | | Re: OO programing in RCX
|
|
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 (...) (26 years ago, 12-Jan-00, to lugnet.robotics.rcx)
|
| |
 | | Re: OO programing in RCX
|
|
(...) OO works very well for things like a parse tree. I can add a new statement and just add its rules for semantic checking and code generation...all within its own class. I think part of the problem is that compiler design is a very heavily (...) (26 years ago, 12-Jan-00, to lugnet.robotics.rcx)
|
| |
 | | Re: OO programing in RCX
|
|
I should probably mention again that legOS supports C++, and supports it even better if you add void*builtin_new(size_t n){return malloc(n)}; to the appropriate library, as v0.3.0 will. The rest of this is off-topic. Dave Baum schrieb: (...) (...) (26 years ago, 12-Jan-00, to lugnet.robotics.rcx)
|
| |
 | | 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 (...) (26 years ago, 11-Jan-00, to lugnet.robotics.rcx)
|
| |
 | | Re: How advanced can RCX programming be?
|
|
(...) but (...) More than that. You can (for instance) have a 'command' thread, which looks at a variable, and decides according to the values on this whether to turn left/right or issue some other response, and does this by changeing other values. (...) (26 years ago, 11-Jan-00, to lugnet.robotics.rcx, lugnet.robotics)
|
| |
 | | Re: How advanced can RCX programming be?
|
|
"TM" == Tobias Möller <tobias.moller@telia.com> writes: TM> If I´ve understood this multi-tasking right, then it means that TM> you can have one program running for the motors of a robot, and TM> another for the sensors, but at the same time. It (...) (26 years ago, 11-Jan-00, to lugnet.robotics.rcx, lugnet.robotics)
|
| |
 | | Re: How advanced can RCX programming be?
|
|
(...) That wasn't me! David Leeper (has been a computer programmer for 17 years! :^)) (26 years ago, 11-Jan-00, to lugnet.robotics.rcx, lugnet.robotics)
|
| |
 | | Re: OO programing in RCX
|
|
Hi Dave, On the RCX side, I wouldn't want true objects. I wouldn't want to fill up the RCX variables with vtables and the program memory with the code to use the vtables. But on the PC side of things I'm beginning to think objects can be very (...) (26 years ago, 11-Jan-00, to lugnet.robotics.rcx)
|
| |
 | | Re: How advanced can RCX programming be?
|
|
In lugnet.robotics.rcx, David Leeper writes: I´m no computer programmer, but I´ve downloaded NQC but haven´t installed it yet. If I´ve understood this multi-tasking right, then it means that you can have one program running for the motors of a (...) (26 years ago, 11-Jan-00, to lugnet.robotics.rcx, lugnet.robotics)
|
| |
 | | Re: OO programing in RCX
|
|
(...) I toyed with a couple of ideas for this, but most of the really useful things can't be done using the standard bytecodes. About the only thing I came up with was a way to wrap the standard API calls up into some classes. However, implementing (...) (26 years ago, 11-Jan-00, to lugnet.robotics.rcx)
|