Subject:
|
temperature sensor problem
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Mon, 3 Jul 2000 15:20:40 GMT
|
Viewed:
|
1702 times
|
| |
| |
It's probably something simple and i'm about to embarrass myself, but
I'm trying to write the equivalent of an RCX Code temperature sensor watcher
with NQC. The motors don't seem to shut off, even when the temperature gets
less than 70... (I added the SetSensorMode in after it didn't work the first
time)
-Ben
// BubbleTemp
task main()
{
SetSensor(SENSOR_1, SENSOR_FAHRENHEIT);
SetSensorMode(SENSOR_1, SENSOR_MODE_FAHRENHEIT);
while(true)
{
if (SENSOR_1 < 70)
{
Off(OUT_A + OUT_C);
}
else
{
On(OUT_A + OUT_C);
}
}
}
|
|
Message has 1 Reply: | | Re: temperature sensor problem
|
| Ben, Internally, the RCX only works with integers, but .1 degree resolution was desired for temperature sensors, so the sensor values are actually measured in .1 degree increments. A reading of 70 degrees F is stored as 700, not 70. If you change (...) (24 years ago, 3-Jul-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
|
|
|
|