To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 27067
27066  |  27068
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 I’ll 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


I’ve 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 doesn’t run any code -- it all runs on the PC. Right now I have the low-level stuff written but haven’t added threading to handle sensors events.

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 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 Microsoft’s Visual Studio IDE.

The API I’m designing won’t be quite like NQC, though. NQC is procedural but C# is object-oriented, so you’ll be writing code like what’s 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 haven’t really finished deciding how I want the API to look. That’s why I have two versions of adding a port above; I can’t 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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR