Subject:
|
Desperate Programming Question
|
Newsgroups:
|
lugnet.org.ca.rtltoronto
|
Date:
|
Sat, 26 Jun 2004 00:19:05 GMT
|
Viewed:
|
517 times
|
| |
| |
I'm so screwed, and I can't figure out why this won't work. Yes, it's for
tomorrow. Language is NQC.
I have a light sensor looking at the rope. I want to "zero" it, after I
latch on and start climbing, and then say, basically "Hey, when the light
value on the sensor goes 5 under what we know the colour of the rope USUALLY
is, you can stop."
So I have something like
#define ropeColour SENSOR_1 // Replace sensor port 1 with ropeColour,
because it's easier to type that way
int whiteRope // placeholder for white rope value.
Then, in the program, once I know I've got the rope in front of the sensor
and it's white:
whiteRope = ropeColour // put the current value of the light sensor, into
the variable whiteRope
whiteRope =- 5 // take 5 off the value of whiteRope
Then, I should have a value in the variable whiteRope which is 5 less than
what I read in?!
But WHY won't this work!? It's driving me nuts!! :(
Iain
|
|
Message has 1 Reply:
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|