Shop OBEX P1 Docs P2 Docs Learn Events
serial communications through ir leds? — Parallax Forums

serial communications through ir leds?

ArchiverArchiver Posts: 46,084
edited 2001-03-12 21:03 in General Discussion
Talking with my son a few days ago we were discussing about
having two stamps talk through ir leds. The idea is to make
two bots that alternate playing a game of tag. One bot
emits an ir signature/frequency while listening, the other
bot listens for the signature/frequency and when its close
enough to the first bot it transmits 'TAG' or sometime. Then
the two bots switch roles.

I know the BS2 has SERIN and SEROUT commands, would these
command work for this scenario or would something else
be better?

Mike

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-03-08 17:12
    Take a look at the Rentron website ( http://www.rentron.com ) they have many
    examples of IR communication.

    Tim
    [noparse][[/noparse]Denver, CO]


    > Talking with my son a few days ago we were discussing about
    > having two stamps talk through ir leds. The idea is to make
    > two bots that alternate playing a game of tag. One bot
    > emits an ir signature/frequency while listening, the other
    > bot listens for the signature/frequency and when its close
    > enough to the first bot it transmits 'TAG' or sometime. Then
    > the two bots switch roles.
    >
    > I know the BS2 has SERIN and SEROUT commands, would these
    > command work for this scenario or would something else
    > be better?
    >
    > Mike
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-08 17:42
    Mike,

    You can use with a circuit shown in BASIC Stamp 1 application note 11
    (www.parallaxinc.com Downloads page). Make sure to keep your transmission
    rate slow (1200 bps or less). You can also use the IR LED and IR detector
    used on the Boe-Bot.

    Andy
    E-Mail...........alindsay@p...

    Parallax, Inc. home page....................www.parallaxinc.com
    BASIC Stamp Educational Resources...........www.stampsinclass.com
    SX Microcontroller University Resources.....www.sxtech.com



    Original Message
    From: Mike Eggleston [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=7PeqaBrR8rhgUNw5qU2zxBb4Ti6sdV4-OATGwUuXJ-_3ZZeFzsIOH38fgrFV8Bclrbp0At0in8X2LfM]mikee@m...[/url
    Sent: Thursday, March 08, 2001 9:03 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] serial communications through ir leds?


    Talking with my son a few days ago we were discussing about
    having two stamps talk through ir leds. The idea is to make
    two bots that alternate playing a game of tag. One bot
    emits an ir signature/frequency while listening, the other
    bot listens for the signature/frequency and when its close
    enough to the first bot it transmits 'TAG' or sometime. Then
    the two bots switch roles.

    I know the BS2 has SERIN and SEROUT commands, would these
    command work for this scenario or would something else
    be better?

    Mike



    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-09 14:02
    Would a second stamp be required for each of these bots. Looking at the code
    noted in the url below, There is going to be a lot of waiting for these bots to
    communicate with each other. Assuming the bots are rolling around, they won't
    have time to wait on the serial communications.
    What your plan?
    Dave
    --- Tim Goldstein <timg@k...> wrote:
    > Take a look at the Rentron website ( http://www.rentron.com ) they have many
    > examples of IR communication.
    >
    > Tim
    > [noparse][[/noparse]Denver, CO]
    >
    >
    > > Talking with my son a few days ago we were discussing about
    > > having two stamps talk through ir leds. The idea is to make
    > > two bots that alternate playing a game of tag. One bot
    > > emits an ir signature/frequency while listening, the other
    > > bot listens for the signature/frequency and when its close
    > > enough to the first bot it transmits 'TAG' or sometime. Then
    > > the two bots switch roles.
    > >
    > > I know the BS2 has SERIN and SEROUT commands, would these
    > > command work for this scenario or would something else
    > > be better?
    > >
    > > Mike
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-09 14:47
    On Fri, 09 Mar 2001, david cousins wrote:

    > Would a second stamp be required for each of these bots. Looking at the code
    > noted in the url below, There is going to be a lot of waiting for these bots
    to
    > communicate with each other. Assuming the bots are rolling around, they won't
    > have time to wait on the serial communications.
    > What your plan?
    > Dave
    > --- Tim Goldstein <timg@k...> wrote:
    > > Take a look at the Rentron website ( http://www.rentron.com ) they have many
    > > examples of IR communication.
    > >
    > > Tim
    > > [noparse][[/noparse]Denver, CO]
    > >
    > >
    > > > Talking with my son a few days ago we were discussing about
    > > > having two stamps talk through ir leds. The idea is to make
    > > > two bots that alternate playing a game of tag. One bot
    > > > emits an ir signature/frequency while listening, the other
    > > > bot listens for the signature/frequency and when its close
    > > > enough to the first bot it transmits 'TAG' or sometime. Then
    > > > the two bots switch roles.
    > > >
    > > > I know the BS2 has SERIN and SEROUT commands, would these
    > > > command work for this scenario or would something else
    > > > be better?
    > > >
    > > > Mike

    I'm still forming a plan on how to do this. I was thinking of timing
    the main loop through all motors and sensors and then putting a serin
    with a short timeout. The one bot would xmit repeatedly until the
    tagged bot sent out an 'ok' or something.

    Mike
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-12 21:03
    David,

    Your project is going to take some work. The idea is to parse the
    communication during the pause time between two or three servo pulses. Here
    are a few ideas that might help.

    You have plenty of time, namely 20 ms between each servo pulse. The code
    will take some work though. I'm assuming you want to broadcast three
    different messages, "Tag, you're it.", "Rats, you got me; OK, I'm it", and
    "Reply confirmed"

    Assign "Tag, you're it." the value %10101010.
    Assign "Rats, you got me." the value %11001100
    Assign "Reply confirmed." the value %11111111

    After delivering each servo pulse, "not-it-Bot" should not be broadcasting
    infrared. By checking to see if IR is detected, it can know if the "it-Bot"
    is in the proximity.

    If it-Bot is proximate, not-it-Bot should listen for a serin signal with a
    timeout of about 10 ms. If it gets something other than all 0s, it knows
    that it may have been tagged. Analysis of the byte might confirm, or it
    might just suggest. The byte might have been captured mid-stream, in which
    case, it might be something like %0001010. That's a definite "tag", so
    check for objects, deliver one more servo pulse, then broadcast "Rats, you
    got me." in between the next 4 pulses along with checking for the confirm
    byte (anything better than %00000111) means the other bot is confirming.

    A not definite tag might be %00000001. In this case, not-it-Bot will have
    to check again after delivering its next servo pulse.

    Andy
    E-Mail...........alindsay@p...

    Parallax, Inc. home page....................www.parallaxinc.com
    BASIC Stamp Educational Resources...........www.stampsinclass.com
    SX Microcontroller University Resources.....www.sxtech.com



    Original Message
    From: david cousins [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=2waRzcWNdj8mdIc39BIgCY3_-1AAYvrZRW46nFedQ2DcFYhwTN-p0VRcoMOiETanESoUSPvcsQwJcfS7]cuz_hsv@y...[/url
    Sent: Friday, March 09, 2001 6:03 AM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] serial communications through ir leds?


    Would a second stamp be required for each of these bots. Looking at the
    code
    noted in the url below, There is going to be a lot of waiting for these bots
    to
    communicate with each other. Assuming the bots are rolling around, they
    won't
    have time to wait on the serial communications.
    What your plan?
    Dave
    --- Tim Goldstein <timg@k...> wrote:
    > Take a look at the Rentron website ( http://www.rentron.com ) they have
    many
    > examples of IR communication.
    >
    > Tim
    > [noparse][[/noparse]Denver, CO]
    >
    >
    > > Talking with my son a few days ago we were discussing about
    > > having two stamps talk through ir leds. The idea is to make
    > > two bots that alternate playing a game of tag. One bot
    > > emits an ir signature/frequency while listening, the other
    > > bot listens for the signature/frequency and when its close
    > > enough to the first bot it transmits 'TAG' or sometime. Then
    > > the two bots switch roles.
    > >
    > > I know the BS2 has SERIN and SEROUT commands, would these
    > > command work for this scenario or would something else
    > > be better?
    > >
    > > Mike
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/



    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.