Shop OBEX P1 Docs P2 Docs Learn Events
BS2px and I/R, and some parallel processing — Parallax Forums

BS2px and I/R, and some parallel processing

TigerNinjaTigerNinja Posts: 4
edited 2008-11-30 02:54 in BASIC Stamp
So guys, I've been messing around with a Boe-bot for quite a while for my class. However, I've now ran into a crippling problem: the BS2 stamp reads my I/R Transceivers (IR LED and IR Receiver) correctly, i.e. it can detect objects; my BS2px does not (one transceiver reads 1, or no object, the other reads 0, or object detected at all times.). Normally this wouldn't be a problem, as I would just use the BS2 for roaming, yet it gets a bit more complicated.

When using my roaming program (I made my own, but upon finding it broken, I reverted to the copy/paste off of the parallax books method to be sure that my code isn't causing some unseen problem), with the BS2, that is, the transceivers work correctly and detect objects, yet the bot continuously spins clockwise. Sadly, when I gave it a 'Full Ahead' command only, it also moved clockwise, continuously, no matter the movement command inputted.
However, when I switch off to the BS2px, all movement seems to work correctly, yet as I said above, the transceiver pairs do not work; one will always read 'Object Detected', the other will always read the opposite.

Any Solutions to this? Or ideas, because I'm at a point of frustration here.

Lastly, one possible workaround I thought about was parallel processing; I have two boards, I have two processors. I was thinking along the lines of using the BS2 to detect objects, then, depending on the detection, sending a 1 or 0 (or 11 or 00, depending on whether it detected on the left or right transceiver, or both or none) to the 'upper' board where the BS2px will receive the information, and send out the related movement commands. Is this possible, or is there a better way of doing this?

One more thing, I was planning on using a remote to put the robot in the correct modes (1 puts it on roaming, 0 will return it to the main menu switch, 2/5/4/6 will control it going forward/backward/left/right respectively...), yet though this works right on the BS2px, the bot stutters horridly when this same program is used for the BS2. Any ideas?

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-11-29 20:56
    Take a look at the help files for freqout and pulsout. the px has different timing than the bs2 and you need to change your code to accomodate the chips.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • TigerNinjaTigerNinja Posts: 4
    edited 2008-11-29 21:12
    Goodie. I have just looked up all specifications I could find about the different Stamps, but still don't know what the hell I'm looking for. I realize it has a different timing, yet what do I need to do to adjust my code?

    EDIT: I just found some interesting info. BS2's FREQOUT command goes from 0 to 32767 Hz, with 1ms durations, whilst the BS2px goes from 0 to 197585 with .166ms durations. Now, what to make of this info?

    Post Edited (TigerNinja) : 11/29/2008 9:21:59 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-11-29 21:20
    TigerNinja -

    Perhaps it's time to download the PBASIC Manual from the Parallax web site. That has all that information and more.

    Regards,

    Bruce bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.
  • TigerNinjaTigerNinja Posts: 4
    edited 2008-11-29 21:55
    So.... Since the timing duration difference is about 10x, do I need to multiply my duration I used on a BS2 by 10 to get the new duration for the BS2px?

    And, Bruce Bates, I appreciate the help, but I am not a complete moron. I checked the manual already, and just knowing the difference doesn't help to much when I don't know what to make OF it. And the manual doesn't tell you that, unless we are talking about different manuals here.
  • flying_flipflying_flip Posts: 36
    edited 2008-11-29 22:10
    The way I read page 199 in the manual is this

    1ms /.166ms is the conversion factor needed for the duration
    1hertz / 6.03hertz is the conversion factor needed for the tones

    between the BS2 and the BS2px

    Someone double check me...

    Phil
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-11-29 22:10
    Tiger Ninja -

    I never took you for a moron. Why you would say that baffles me.

    On a daily basis there are many newcomers to these forums. Am I supposed to remember who has read the manuals, and who hasn't? BTW, I'm not used to such comments on these forums, but I've only been here TEN years, so it may have gone on before I got here!

    Take a breath before your next posting.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.
  • TigerNinjaTigerNinja Posts: 4
    edited 2008-11-29 22:24
    @Bruce Bates
    I never once suggested that you did not know more than me on this issue, nor that you had less experience. However, when I say I have just looked up all of the specifications I can find, that means the manual too, unless Parallax unexpectedly hid it. I can see there are many newcomers, yet most seem to get direct answers, not simply "Go and check the manual... It explains all!". Look at the post (think its the third one down), the EEPROM question is answered directly and not with a 'Look it up' (just an example of many, many good answers.).

    EDIT: The post I was referring to is here: http://forums.parallax.com/showthread.php?p=766989
    @Phil
    Thanks, that's what I suspected but I wasn't sure. I checked and that's how it works, case closed, thank you.
  • FranklinFranklin Posts: 4,747
    edited 2008-11-30 02:54
    When you get into baud rates you will find you also need to make adjustments for processor speeds so be forewarned.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.