This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

template for generic drivers
#8
Hi Admin,

I figured it out.  I can use copas to add a new thread, then put it to sleep until its needed.


Code:
 co = copas.addthread(function()
    while true do
      copas.sleep(2) -- wait 2 seconds
      alert("send some command")
      copas.sleep(-1) -- put the thread to sleep until wakeup is called
    end
  end)



then when I need to activate it I use

Code:
copas.wakeup(co)



Thanks,


Roger
Reply


Messages In This Thread
template for generic drivers - by rocfusion - 16.06.2017, 23:40
RE: template for generic drivers - by admin - 04.07.2017, 05:59
RE: template for generic drivers - by admin - 04.07.2017, 17:33
RE: template for generic drivers - by rocfusion - 04.07.2017, 19:27

Forum Jump: