Go to advanced search

by theegg
Tue Jan 22, 2019 5:44 am
Forum: Automation, sensing and robotics
Topic: how to set up multitasking
Replies: 19
Views: 4757

Re: how to set up multitasking

Thanks to everybody for the help so far. I put this project aside for a while but have now started it up again. Have done a lot of rewrites trying to make the code more pythonic and have used the threaded callbacks in the GPIOzero library to simplify some of the issues. I'm still using threads for o...
by theegg
Sat Sep 16, 2017 6:19 am
Forum: Automation, sensing and robotics
Topic: how to set up multitasking
Replies: 19
Views: 4757

Re: how to set up multitasking

I'm pretty sure that the problem relates to the line tornado.ioloop.IOLoop.instance().start() The tornado documentation and the code I cut and pasted from say this line should be at the end of the main section of the program. This plus the name of the command implies to me that this starts off a con...
by theegg
Fri Sep 15, 2017 3:47 am
Forum: Automation, sensing and robotics
Topic: how to set up multitasking
Replies: 19
Views: 4757

Re: how to set up multitasking

You obviously haven't read the posts. I have got threading working on all of my I/O's etc. I just doesn't want to play with the tornado library.
by theegg
Fri Sep 15, 2017 3:11 am
Forum: Automation, sensing and robotics
Topic: how to set up multitasking
Replies: 19
Views: 4757

Re: how to set up multitasking

Thought I'd already given an update a month or 2 ago but can't see it anymore. I fixed the esc key not working by setting the thread as a daemon. This allows the main program to shut down even while the threads are still running. Anyhow my project has developed further. My program uses an Adafruit T...
by theegg
Fri Jul 21, 2017 8:29 am
Forum: Automation, sensing and robotics
Topic: how to set up multitasking
Replies: 19
Views: 4757

Re: how to set up multitasking

Got it 99% working by using threading. Only 1 outstanding issue. My main loop uses a pygame event to look for the Esc key to stop the program. This is in the same loop that reads the digital inputs. The digital inputs work correctly but the Esc key no longer stops the program and I have to power dow...
by theegg
Wed Jul 19, 2017 6:17 am
Forum: Automation, sensing and robotics
Topic: how to set up multitasking
Replies: 19
Views: 4757

Re: how to set up multitasking

Thanks ghans. I have had a quick search on your suggestions and they look like what I'm after. Let's see if I can get something to work.
by theegg
Tue Jul 18, 2017 11:27 pm
Forum: Automation, sensing and robotics
Topic: how to set up multitasking
Replies: 19
Views: 4757

how to set up multitasking

I have a small automation project using python. I have some pushbuttons connected to the digital inputs running some code. I also have a temperature sensor connected to the 1-wire bus running some other code. The program runs at a fixed cycle time of 1s using the pygame clock.tick() function. It all...

Go to advanced search