renowden
Posts: 6
Joined: Sat Nov 12, 2016 8:18 am
Location: Bristol, England
Contact: Website

flashing LED !

Wed Feb 01, 2017 8:16 am

Hi - I know that this is the most basic of Python / Pi programs, to make a LED flash.

I want to take this a step further (I am an experienced programmer) - is there an asynchronous call system in Python that would allow me to run the "flashing LED" function in the background whilst doing real work in another part of the program? As an example, if I wanted to use the flash pattern to indicate what the mainf the program is doing - so I need to be able to start it, stop it and pass parameters to it either on startup or while it is running.

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: flashing LED !

Wed Feb 01, 2017 8:54 am

Threads/threading.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: flashing LED !

Wed Feb 01, 2017 8:59 am

What @joan said!

There is a tutorial series here that might give you a heads up to what can be done: http://raspi.tv/2013/how-to-use-interru ... d-rpi-gpio

renowden
Posts: 6
Joined: Sat Nov 12, 2016 8:18 am
Location: Bristol, England
Contact: Website

Re: flashing LED !

Wed Feb 01, 2017 9:18 am

Yeah - threads. That is what I was looking for - the name so I could search for it, Thanks.

Return to “Python”