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 / 20101
20100  |  20102
Subject: 
Newbie NQC Spybot problems
Newsgroups: 
lugnet.robotics
Date: 
Tue, 21 Jan 2003 15:24:09 GMT
Viewed: 
1012 times
  
I'm a total newbie so please excuse stupidity!

Trying to learn NQC with a Spybot and have problems.

Using Bcc 3.3.3.7.1 with NQC 2.5a4 with a Lego Spybot on a Windows XP PC.


The following does not obey the repeat for number of times command, the
action in the repeat loop just carries on forever.

include "spy.nqh"
task main()
{
repeat (3)
{
  OnFor (OUT_A,200);
  Wait (200);
}
}

Also in the next example;

#define THRESHOLD 40

task main()
{
  SetSensor(SENSOR_2,SENSOR_LIGHT);
  OnFwd(OUT_A+OUT_B);
  while (true)
  {
    if (SENSOR_2 > THRESHOLD)
    {
      OnRev(OUT_B);
      Wait(10);
      until (SENSOR_2 <= THRESHOLD);
      OnFwd(OUT_A+OUT_B);
    }
  }
}

Compile reports....Error: undefined variable 'SENSOR_LIGHT'
Similar error reports for using SENSOR_TOUCH.

Am I wrong in thinking that I can use these progs with a Spybot?
or am I missing something obvious.

P.S I have setup Bcc to target a Spybot and simple motor on/off commands
work fine.

Thanks for any help
Regards
Philip



Message has 1 Reply:
  Re: Newbie NQC Spybot problems
 
(...) This is interesting. When compiled with RCX2 as the target it yields: 000 pwr ABC, 7 13 07 02 07 004 dir ABC, Fwd e1 87 006 setv var[47], 3 14 2f 02 03 00 011 decvjnl var[47], 30 f3 2f 11 00 015 out A, On 21 81 017 wait 200 43 02 c8 00 021 out (...) (22 years ago, 21-Jan-03, to lugnet.robotics, lugnet.robotics.rcx.nqc)

4 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Contact Recovery Nerd for Speedy USDT / BTC Recovery
21 hours ago
Custom Search

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