few issues regarding NXT

News, rumors, and other broad discussion topics.
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: few issues regarding NXT

Post by muntoo »

doc-helmut wrote:why RobotC and not NXC?
Ah, but that's just the language. What about the IDE? (Not that I'm against NXC :D .)
doc-helmut wrote: (exactly C to the ANSI C standard essentials is neither NXC nor RobotC: no pointers, no recursion, no stack, no heap, no stdio)
If you want those things, you can try nxtOSEK, but NXC is easier to set up, IMHO. (I still haven't figured out how to set up nxtOSEK.)

There's also leJOS, if you like the horrible language that is Java. BTW, have you heard this joke:

Knock knock
Who's there?
... [Very long pause]
Java.
goto jail;
... [Very long pause]
Sorry, that's illegal.
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: few issues regarding NXT

Post by mightor »

The programming language bashing stops here. Either give useful info the OP asked for or go make your own thread.
Another thing: I read in one place that there may be some issues between robotC and the robot NXT-2.0 (download problem, etc ...). Is that correct or an old irrelevant information?
The brick is the same for the NXT 1.0 and 2.0 boxes. I have bricks from both the 1.0 and 2.0 sets and don't have any issues.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
linusa
Posts: 228
Joined: 16 Oct 2010, 11:44
Location: Aachen, Germany
Contact:

Re: few issues regarding NXT

Post by linusa »

amitbr, I'd recommend "NXT Power Programming - Robotics in C" by John Hansen, 2nd edition: http://www.amazon.com/Lego-Mindstorms-N ... 0973864974

It uses NXC, which is similar to RobotC (as in: it's a C-dialect). It's free and possibly the most widely used language for NXTs (next to NXT-G of course).
RWTH - Mindstorms NXT Toolbox for MATLAB
state of the art in nxt remote control programming
http://www.mindstorms.rwth-aachen.de
MotorControl now also in Python, .net, and Mathematica
amitbr
Posts: 11
Joined: 12 Jan 2011, 09:19

Re: few issues regarding NXT

Post by amitbr »

Hi,

I spend yesterday a lot of time reading the great tutorial in robotc.net.
It really seems that someone invested a lot of time and effort on that and I am now confident it is a good language.

One question: Does ROBOTC supports all sensors and muxes? (color, engine mux, Gyro which I intent to use also)?
Is it a standard among the third party companies which produce hardware for NXT? Will they supply the need procedures?

thanks,
Amit
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: few issues regarding NXT

Post by mightor »

One question: Does ROBOTC supports all sensors and muxes? (color, engine mux, Gyro which I intent to use also)?
Is it a standard among the third party companies which produce hardware for NXT? Will they supply the need procedures?
I have written a driver suite for ROBOTC which is also included with the installation (not always 100% up to date). You can download it from one of the links in my signature. It has drivers for pretty much every single sensor available on the market for the NXT and a couple of extra ones, too. My drivers are the official ROBOTC ones for HiTechnic and Dexter Industries. Although Mindsensors does produce their own drivers as well, my suite supports all of their sensors with the exception of the Sumo Eyes.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
amitbr
Posts: 11
Joined: 12 Jan 2011, 09:19

Re: few issues regarding NXT

Post by amitbr »

Hi,

Can I find anywhere a robotC code that will operate the color ball sorter robot which its build instructions comes with the NXT 2.0 box?
I am referring to that one: http://www.youtube.com/watch?v=MSde6tvGn1s

In addition, where can I find a robotC example how to control the robot (even the most basic one) through keyboard? (activate motors)

thanks,
amit
amitbr
Posts: 11
Joined: 12 Jan 2011, 09:19

Re: few issues regarding NXT

Post by amitbr »

anyone can answer please?
thanks,
amit
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: few issues regarding NXT

Post by mightor »

I don't think you can control the robot through the keyboard in ROBOTC. You can use a joystick or one of those gamepads, though.

As for code for the 2.0 models, I'm afraid you'll have to make it yourself :) There is a good tutorial for ROBOTC, though. Just go to my website at the bottom of this message and look on the right side of the page.

The robotics academy also have some really good tutorials on their website. http://www.robotc.net/education/curriculum/nxt/

Also, check out the sample code that is shipped with ROBOTC. Just go to file->open sample program and pick one of the examples to look at. An older version of my driver suite is also included there. You can always download a more recent one from the link in my signature.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
amitbr
Posts: 11
Joined: 12 Jan 2011, 09:19

Re: few issues regarding NXT

Post by amitbr »

Correct me if I am wrong, but in the NXT-G you can control the motors using the keyboard?

regarding the tutorial: I read it form start to end. It is good but basic (for someone who is familiar with programing).
One thing I did not see for example is how to read the color sensor (the examples there are for the light sensor only).
Is there an example for the color sensor also?

Thanks,
Amit
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: few issues regarding NXT

Post by mightor »

You are not wrong, but ROBOTC just doesn't offer that ability, not through the keyboard anyway.

Here's a program to display the colour currently being detected by colour sensor.

Code: Select all

#pragma config(Sensor, S1,     colorPort,           sensorCOLORFULL)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
  string sColor;

  while (true) {
    switch (SensorValue[colorPort])
    {
      case BLACKCOLOR:    sColor = "Black";     break;
      case BLUECOLOR:     sColor = "Blue";      break;
      case GREENCOLOR:    sColor = "Green";     break;
      case YELLOWCOLOR:   sColor = "Yellow";    break;
      case REDCOLOR:      sColor = "Red";       break;
      case WHITECOLOR:    sColor = "White";     break;
      default:            sColor = "???";       break;
    }
    nxtDisplayCenteredTextLine(2, sColor);
    wait1Msec(50);
  }
}
Regards,
Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests