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

BS2 Multitasking

BorisBoris Posts: 81
edited 2004-12-19 01:50 in BASIC Stamp
Is it possible to do "multitasking" with BS2 ?
1) Lets say i need to set PIN5 High for 4 seconds. But in that time i also need to do some other operations. I know that those operations will take less than 4 seconds to complete.
or
2) I need to set PIN5 Hihg for 4 seconds unless PIN6 becomes high during those 4 seconds, then set PIN5 Low earlier
or
3) Set PIN5 for PWM output and do something else in the meantime, then comeback and turn PWM off.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2004-12-15 20:58
    Yes and no. The BS2 is 'single-tasking'. Thus, there is NO 'PWM in the background' you can do.

    Yes, you can 'simulate' multi-tasking by doing what Jon has said in the 'Interrupt' thread.

    You'll need an external source of time-ticks if you want your work to be clock-synchronized.
  • dandreaedandreae Posts: 1,375
    edited 2004-12-19 01:50
    Hello,

    There is a PWM PAL that will work for this project, you simply plug the BS2 into the PWM PAL and then plug that into your board.· This will allow you to use PWM and perform other tasks at the same time.· Here is a link for more information:· http://www.parallax.com/detail.asp?product_id=28020·.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
Sign In or Register to comment.