BS2 Multitasking
Boris
Posts: 81
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.
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
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.
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
·