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 / 1176
1175  |  1177
Subject: 
About SensorValueRaw(SENSOR_3) in Scout
Newsgroups: 
lugnet.robotics.rcx.nqc
Followup-To: 
lugnet.robotics.scout
Date: 
Sat, 14 Jul 2001 20:05:46 GMT
Viewed: 
2618 times
  
I tried to get raw value of sensors in Scout, the SensorValueRaw(0/1) is ok, I
get the raw values of Sensor1 and Sensor2, but I found SensorValueRaw(2)
doesn't work, no value is returned.
Then I found a example in NQC Guide Version 2.3 r1, it is
SensorValueRaw(SENSOR_3), but it can't be compiled, I found SENSOR_3 is defined
SensorValue(2) in rcx2.nqh.
How can I read raw value of light sensor in Scout?

Br
Zhengrong



Message has 2 Replies:
  Re: About SensorValueRaw(SENSOR_3) in Scout
 
(...) I think SensorValueRaw(2) should do what you want. I wrote a little test program: ---- int x, y; task main() { y = 0; while(true) { x = SensorValueRaw(2); if (x > (y + 10)) PlaySound(SOUND_CLICK); y = x; } } ---- and it seems to click a lot as (...) (23 years ago, 18-Jul-01, to lugnet.robotics.scout)
  Re: About SensorValueRaw(SENSOR_3) in Scout
 
Zhengrong, I'm sure you figured this out by now, but I just got it last night so here is a task which reads the light sensor and outputs a sound based on the raw reading. task drone() { CalibrateSensor(); while (shut_up==0) { int b = (...) (23 years ago, 16-Dec-01, to lugnet.robotics.scout)

5 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