PDA

View Full Version : Prop Educ Kit - TestIrDutyDistanceDetector.spin odd behavior



TimZ
05-17-2010, 01: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

rjo_
05-17-2010, 11:18 AM
Tim,

I haven't worked with this and am just about lights out tonight. A lot of guys are still not home from the meeting.
Sorry for the delay. If someone with the right answer doesn't respond in the morning, I'll try to take a look.

Rich

Post Edited (rjo_) : 5/18/2010 10:05:54 PM GMT

rjo_
05-19-2010, 06:05 AM
Tim,


Ok... everyone is back home and just about decompressed. Have you figured it out?
If not would someone with the right answer please come forward:)

Rich

TimZ
05-19-2010, 09:16 AM
Rich & any others,

Still not clear what's going on.

Thanks,

- Tim

rjo_
05-19-2010, 09:41 AM
Tim...

I was planning to do this tonight... after I failed to keep my promise yesterday... I am tutoring my son through it and I got to the exact page... and the phone range.. we were late for our golf lesson... Now I'm home, thoroughly exhausted.

Many of the guys that could answer your post without blinking an eye have no idea what you are talking about and aren't going to look in the text to try to figure it out.

Post the code... as best you can... don't worry if it looks a little funky. And presto digito... the answer will come out like you waved a magic wand.

If that doesn't work... nothing is perfect... I absolutely ... positively ... and for sure will get to it tomorrow unless a rock falls on my head:)

I have an idea ... but I'm too tired to filter my own thinking right now and don't want to confuse you even further.

Regards,

Rich

tmaynard
05-19-2010, 10:20 PM
TimZ said...
I’d appreciate any feedback anyone may have as to why this mysterious behavior may be happening.

I had problems on that exercise, too. In my case I (finally) realized that I was using an IR transistor instead of the IR diode. Swapping that out made a world of difference.

I assume you're using the "canned" code from Parallax, but if not certainly give it a try instead of any manually input code.

If you can attach a photo of your setup that would also be quite helpful ... indicate which lead is which on the parts, etc.

Tom.