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 / 1278
1277  |  1279
Subject: 
Re: How to read the touch sensors on the Scout in NQC?
Newsgroups: 
lugnet.robotics.rcx.nqc, lugnet.robotics.scout
Date: 
Sun, 16 Dec 2001 12:04:42 GMT
Viewed: 
5258 times
  
I've sort of solved my problem, but not in a way which really makes
total sense. Both of the below fragments work as expectd:

#1 if ((SensorValueRaw(1) & SensorValueRaw(0)) != 255)

#2 if ((SensorValueRaw(1) != 255) || (SensorValueRaw(0) != 255))

Number two is obvious but rather verbose, number one is just wierd!
Since I'm accustomed to Perl which allows extreme lazyness I would have
thought that I could just do this:

if ((SensorValueRaw(1) || SensorValueRaw(0) != 255))

But that does not work. Is this normal in NQC?

Chris"at"superfami"dot"com



Message has 1 Reply:
  Re: How to read the touch sensors on the Scout in NQC?
 
Hi Chris, (...) this is a bit crazy, unless your sensor value is a bit pattern. (...) This is sensible, but are you sure it's ok to use equality and not inequalities like SensorValueRaw(1) < 240? (...) but it's equivalent, also in C, where & is (...) (23 years ago, 16-Dec-01, to lugnet.robotics.rcx.nqc, lugnet.robotics.scout)

Message is in Reply To:
  How to read the touch sensors on the Scout in NQC?
 
All, I'm feeling pretty stupid right about now. I've read the NQC docs, looked in the newsgroups, books, etc, but I can't seem to figure out how to read the touch sensors on my Scout. I want to implement a bumper checking task but no matter how I (...) (23 years ago, 16-Dec-01, to lugnet.robotics.rcx.nqc, lugnet.robotics.scout)

6 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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