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 / 18159
18158  |  18160
Subject: 
RE: intro and question
Newsgroups: 
lugnet.robotics
Date: 
Mon, 17 Jun 2002 18:00:12 GMT
Original-From: 
Nathan Nesbit <nathann@windowsNOSPAM.microsoft.com>
Viewed: 
778 times
  
I wondered why they included NQC in the Ada/Mindstorms distribution so I
d/led all 26MB or so and tried it out.  In turns out that they compile
the ADA code into NQC code.  They they run NQC over that to produce code
which runs on the RCX.

It offers a nice comparison between the two.  Here is both versions of a
function included in the sample test file the ada/mindstorms stuff.

Enjoy

/*************** Ada/Mindstorms

procedure Turn (Direction : in     Integer ) is
   begin
      if Direction = Left then
         Output_Off(Output => Left_Wheel);
         Output_Power(Power  => Power_Low, Output => Right_Wheel);
         Output_On_Forward(Output => Right_Wheel);
         Wait(Hundredths_Of_A_Second => 100);
         Output_Off(Output => Right_Wheel);
      else --right
         Output_Off(Output => Right_Wheel);
         Output_Power(Output => Left_Wheel,Power  => Power_Low);
         Output_On_Forward(Output => Left_Wheel);
         Wait(Hundredths_Of_A_Second => 100);
         Output_Off(Output => Left_Wheel);
      end if;
   end Turn;

/****************** NQC

void TURN ( int DIRECTION )

{
   if ( DIRECTION == LEFT )
   {
      Off( LEFT_WHEEL ) ;

      SetPower( RIGHT_WHEEL , 1 ) ;
      OnFwd( RIGHT_WHEEL ) ;
      Wait( 100 ) ;
      Off( RIGHT_WHEEL ) ;

   }
   else
   {
      Off( RIGHT_WHEEL ) ;

      SetPower( LEFT_WHEEL , 1 ) ;
      OnFwd( LEFT_WHEEL ) ;
      Wait( 100 ) ;
      Off( LEFT_WHEEL ) ;

   }



}

-----Original Message-----
From: Laura O'Grady [mailto:l.ogrady@sympatico.ca]
Sent: Sunday, June 16, 2002 10:42 AM
To: lego-robotics@crynwr.com
Subject: intro and question


Hello everyone!

I have been semi-lurking on the list for a few months, with the
occasional post.  I have only recently gotten into Mindstorms and wanted
to ask about moving on to another language to program the RCX with.  I
have no programming skills whatsoever so I am requesting the sage advice
of the list on which direction I should go.

I have done a bit of research and was able to find a demo version of
ROBOLAB.  This version works only with a serial IR and I have the USB
version.  Plus I really didn't think the interface was all that great so
I deleted it.

So now I am considering purchasing either "Dave Baum's Definitive Guide
to LEGO Mindstorms" to learn NQC or "Core LEGO MINDSTORMS Programming:
Unleash
the Power of the Java Platform" by Brian Bagnall to learn JAVA.   I just
ran a quick search and found this interesting article called
"Ada/Mindstorms 3.0: A Computational Environment for  Introductory
Robotics and Programming" (found at
http://www.faginfamily.net/barry/Papers/IEEERA.htm).  In this article
the author advises that NQC is difficult for the novice programmer to
learn and use.

So now I am concerned about going the NQC route.  Maybe I should try
this Ada/Mindstorms software.  Any thoughts?  Also what is the
relationship between RcxCC and NQC? Thanks.

Laura



1 Message 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