TimZ
05-17-2010, 12:29 AM
Hi,
When I run the Propeller Education Kit Labs ‘TestIrDutyDistanceDetector.spin’ program I get out very small values, on the order of 25, for the maximum value when I point the detector at a wall which is very far away. The manual gives sample values of over 100.
BUT, when I take the loop variable ‘duty’, which is in ‘IrDetector.spin’, and have it loop between, say 0 and 150, instead of 0 and 255, I get values greater than 100. It is a mystery as to how I can decrease the number of times the loop is gone through and the variable ‘dist’ can decrease in value. This variable ‘dist’ should increase as you increase the number of times the loop cycles through.
I have checked very carefully my setup, measuring the resistor values with a voltmeter, checking the wiring, etc.
I’d appreciate any feedback anyone may have as to why this mysterious behavior may be happening.
- Tim
When I run the Propeller Education Kit Labs ‘TestIrDutyDistanceDetector.spin’ program I get out very small values, on the order of 25, for the maximum value when I point the detector at a wall which is very far away. The manual gives sample values of over 100.
BUT, when I take the loop variable ‘duty’, which is in ‘IrDetector.spin’, and have it loop between, say 0 and 150, instead of 0 and 255, I get values greater than 100. It is a mystery as to how I can decrease the number of times the loop is gone through and the variable ‘dist’ can decrease in value. This variable ‘dist’ should increase as you increase the number of times the loop cycles through.
I have checked very carefully my setup, measuring the resistor values with a voltmeter, checking the wiring, etc.
I’d appreciate any feedback anyone may have as to why this mysterious behavior may be happening.
- Tim