To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 482
481  |  483
Subject: 
NQC troubles
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Tue, 29 Feb 2000 13:50:51 GMT
Viewed: 
2035 times
  
Hi, I am pretty new to the lego robotics thing (but I have been a lego maniac
since birth), and have had a lot of fun tinkering with the mindstorms set that
I got for Christmas. I have recently downloaded Nqc and RCX command center.
While working on a program for a robotic arm I made, I was having trouble with
an 'if' statement. The arm has a touch sensor that will be pressed when the arm
has reached its highest point. Following an example program that came with
RCXCC, I did the following:
OnFwd(OUT_A);
if (SENSOR_1 == 1)
Off(OUT_A);
Seems simple enough, right? Turn on the motor, and then turn it off when the
sensor is pushed. The dumb thing just doesn't work! I thought the touch sensor
might be messed up, so I wrote another simple program to make a sound, and then
used an if statement to make a different sound when the sensor is pushed. It
worked fine! I don't understand what is wrong. I checked the value of the
sensor when the arm is fully raised, and the RCX display says 1 !? Could anyone
help???
Rob Stehlik
Robbby31@hotmail.com



Message has 1 Reply:
  Re: NQC troubles
 
(...) Hi. The problem is that the if statement doesn't wait -- it just checks once, and if it fails, goes right past. So, if you have the switch pushed down right at the beginning, it'll work. Try this: OnFwd(OUT_A); until (SENSOR_1 ==1); (...) (25 years ago, 29-Feb-00, to lugnet.robotics.rcx.nqc)

4 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