Shop OBEX P1 Docs P2 Docs Learn Events
Using ping and ir at the same time — Parallax Forums

Using ping and ir at the same time

tronsnavytronsnavy Posts: 70
edited 2009-09-14 23:47 in Accessories
All,
·
Greetings from VA Beach.· Hope everyone is well.· Got a question.· My BOE is doing great with PING.· He is going around, finding walls and such, but he doesn't see "clothes" very·well.· ·I am trying to get both·PING and 2 X IR sensors to work at the same time.· I am using a propeller.· Does anyone have a suggestion? Thanks and have a great weekend.
·
Bob
·
Freedom is worth fighting for; it will ensure posterity experiences the same. [noparse][[/noparse]Theron Hudson]

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2009-09-06 05:05
    tronsnavy,

    Show us the code that you are using thus far and a schematic if you are able. Since PING and IR do not interfere with one another it is completely possible to have multiple forms of object detection.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • tronsnavytronsnavy Posts: 70
    edited 2009-09-07 19:20
    Mr. Schwabe,
    ·
    Thanks for helping.· I attached two spin files to this post.· The first is "My6thTest5.spin".· You may recognize it, as I downloaded it (and then modified it), from the ROBOT MAG website (www.botmag.com); Spring 2008 issue.· The schematic (modified for my BOT) is located at the top of this file.· I would like to give credit to the author, but none of the files contained a name.· Anyway, the second file is "TestIrDutyDistanceDetector.spin".· This one may also be familiar.· It's the file on page 152 of the "PEK Fundamentals" book.· This file, I also modified and contains the code that launches the IR process into cogs.· I know that I didn't comment very well as time seems to be a precious commodity.
    ·
    As I indicated in my previous e-mail, BOE works great with ping... in fact, if you "comment-out" all references to IR in the first spin file, BOE works fine with ping.· I·know·the problem has to do with using the counter modules·and·launching the IR process into a cog.· If your·like me,·you find little time to devote to "outside the family (and work)" projects.···Thanks for anything that anyone can provide.· Have a good one.
    ·
    Bob
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2009-09-08 01:06
    tronsnavy,

    Please use the "File->Archive->Project..." to include all of your object components.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • tronsnavytronsnavy Posts: 70
    edited 2009-09-08 21:42
    Mr. Schwabe,
    ·
    Here is the zipped file (with all objects).· I will have some time this weekend to work this as well.· But I'm sure that someone with more experience would get to a solution faster.· Thanks again for helping out.· Have a good one.
    ·
    Bob
  • TimmooreTimmoore Posts: 1,031
    edited 2009-09-08 22:35
    It looks to me that the ir code will test left and right sensors once and then those cogs will exit. There is no repeat loop in GetDistL/R
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2009-09-09 05:09
    I agree with Tim, when the IR code launches, it only looks at the IR's once.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • tronsnavytronsnavy Posts: 70
    edited 2009-09-11 11:25
    Timmoore, Beau,

    I finally had a chance to look over your suggestion last night.· The file on page 152 includes a repeat loop at the end of the file, that I forgot to include(I feel pretty stupid).· Anyway, I added the repeat command for applicable lines of code.· Still did not work, but I have had a bad felling about the way I used COGNEW.· I ended up calling two objects (one for left IR and one for right IR), and made a few more modifications.· Presto... boe works with IR (with ping disabled). I will get all working this weekend.· Thanks for the help.· Hope you have a great weekend.

    Bob
  • tronsnavytronsnavy Posts: 70
    edited 2009-09-14 23:47
    Finally got both ping and IR working at the same time. My wife puts a "skirt" around our bed that hangs to the floor. When BOE would get close to the bed, ping would not see the skirt and he would start roaming under the bed. With IR, he can now see the skirt and is behaving much better. Thanks for your help.
Sign In or Register to comment.