Subject:
|
Re: Control Lab - serial/USB
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 1 May 2007 20:24:56 GMT
|
Viewed:
|
5305 times
|
| |
| |
In lugnet.robotics, linmix linmix@gmail.com wrote:
|
Jordan Bradford wrote:
|
In lugnet.robotics, linmix linmix@gmail.com wrote:
|
I have Robolab 2.5.4 so I guess Ill be using that. I still need to find
out what other apps there are (Windows and Linux) that I might use as an
alternative.
linmix
|
Ive been working on a .NET-based class (in C#) to communicate with the
Control Lab. It will eventually be a miniature API providing methods to poll
sensors and change output port values. It will be kind of like how leJOS does
things, except the Control Lab doesnt run any code -- it all runs on the PC.
Right now I have the low-level stuff written but havent added threading to
handle sensors events.
|
I know lejos exists... but Im still getting to grips with NQC (if you
know any good advanced tutorials except for the one Dave Boum wrote Id
be really interested). Would what you are developing be in any way like
using NQC (possibly from the command line) to run programs through the
Control Lab?
|
Yes, you can compile C# programs on the command line using the .NET Framework
SDK. You can also install Visual C# 2005 Express Edition and use Microsofts
Visual Studio IDE.
The API Im designing wont be quite like NQC, though. NQC is procedural but C#
is object-oriented, so youll be writing code like whats below.
using Mindstorms.ControlLab; // this is how you include my class' DLL
// ... boilerplate code involving namespaces and your startup class here
// create a Control Lab object
Brick controlLab = new ControlLab("COM1");
// add a touch sensor
Sensor button = new TouchSensor();
controlLab.addPort(1, button);
// add a motor
controlLab.addPort("A", new Motor());
controlLab.Ports["A"].Direction = Forward;
|
|
And so on. I havent really finished deciding how I want the API to look. Thats
why I have two versions of adding a port above; I cant decide which is better.
:)
|
|
Message is in Reply To:
| | Re: Control Lab - serial/USB
|
| (...) I know lejos exists... but I'm still getting to grips with NQC (if you know any good advanced tutorials except for the one Dave Boum wrote I'd be really interested). Would what you are developing be in any way like using NQC (possibly from the (...) (18 years ago, 1-May-07, to lugnet.robotics)
|
12 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|