Shop OBEX P1 Docs P2 Docs Learn Events
Prop Educ Kit - TestIrDutyDistanceDetector.spin odd behavior — Parallax Forums

Prop Educ Kit - TestIrDutyDistanceDetector.spin odd behavior

TimZTimZ Posts: 4
edited 2010-05-19 14:20 in Propeller 1
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

Comments

  • rjo_rjo_ Posts: 1,825
    edited 2010-05-17 03:18
    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_rjo_ Posts: 1,825
    edited 2010-05-18 22:05
    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[noparse]:)[/noparse]

    Rich
  • TimZTimZ Posts: 4
    edited 2010-05-19 01:16
    Rich & any others,

    Still not clear what's going on.

    Thanks,

    - Tim
  • rjo_rjo_ Posts: 1,825
    edited 2010-05-19 01:41
    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[noparse]:)[/noparse]

    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
  • tmaynardtmaynard Posts: 27
    edited 2010-05-19 14:20
    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.
Sign In or Register to comment.