Shop OBEX P1 Docs P2 Docs Learn Events
BS2 — Parallax Forums

BS2

sakulanarutosakulanaruto Posts: 1
edited 2006-12-29 19:41 in BASIC Stamp
My Dear:
I try to set 8 ultrasonic sensors on the Boe - Bot with the BS2 ,
·
and the 8 ultrasonic sensors connect to 8 pins of the BS2 ,
·
if I want the BS2 to process the 8 pins simultaneously (let the 8 ultrasonic sensors emit simultaneously),dose this way work ?

how can I write for the code using BS2 programming??

Best Regards ,

Peter Chou,

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-12-29 10:02
    The Basic Stamps are single-tasking processors, so you can't process multiple instructions simultaneously. The Javelin and the SX chips can be made to multi-task, but again, the tasking isn't truly simultaneous.

    The propeller chip, however, can do this. It has 8 independent cores, known as cogs, that could each process a sensor. If you might be interested in a Propeller-based robot controller, see this one: www.wulfden.org/PRC/
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-12-29 14:36
    You can do each of the 8 sensors in a 'round-robin' fashion, finishing with one before you do the next.

    Doing all 8 "simultaneously" could be a problem. If one 'hears' echo's coming from another unit -- how do you insure that the sound from #1 (for example) bounced off what #1 was pointing at? It could have been an echo from what #4 was pointing at.

    And even a fast processor might have a problem starting the 'ping' at exactly the same time. Any delay in any sensor's start of ping could throw off the distance measure of an other sensor.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-29 19:41
    All 8 pins could be triggered at the same time…But the BASIC Stamp needs the PULSIN instruction to read the return pulse width…That would not be possible on all 8 lines, as mentioned. ·But, even if it were, you would likely get interference from the sensors all transmitting at the same time from echo, etc. ·Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.