Quote:
Originally posted by Noah
you could sum the values of the bits...
--------------------code-------------------
sensorPower = sensorReadings.bit0 + sensorReading.bit1 + ... + sensorReading.bit8
This would yeild a value between 1 and 8 that would increase and decrease in a linear fashion.
|
Technically, that doesn't really measure the "strength" it measures the duration. The sensor will give off a constant ON signal if it is directed in the right place and the robot doesn't move. The summation might be problematic when your moving, say you move, you have a raw count, it could be 11111000. Unless you count the individual bits and their chronological order, this information would be useless. You could tell when your getting closer and farther away, but it doesn't specify a direction. Without chronological order or doing each bit separate, it seems useless to count the bits.