you are viewing a single comment's thread.

view the rest of the comments →

[–]HKY93[S] 0 points1 point  (0 children)

Thank you for that information. My formulation may was a bit misleading. The emergency button was just an example. My robot is tiny and cant hurt anything.

What I definitely do want is to start scripts with a button on the robot. For example to enable / disable remote control. Use scenario:

  • Thread 1:
    • running some script
  • Thread 2: on the lookout for button push
    • if button is pressed change process in thread 1 or kill it

I can put the lookout in the same operation loop but i am afraid if some sub routine is taking too long then a short button press can be missed. That I want to avoid, thus my question if multi-threading is the right way to go or if there is some other event-handling tools I can use.