diff options
Diffstat (limited to 'Lasers_und_stuff/Cannon.py')
-rw-r--r-- | Lasers_und_stuff/Cannon.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lasers_und_stuff/Cannon.py b/Lasers_und_stuff/Cannon.py index b997284..f124ce6 100644 --- a/Lasers_und_stuff/Cannon.py +++ b/Lasers_und_stuff/Cannon.py @@ -5,10 +5,19 @@ Created on Nov 11, 2012 ''' import serial import glob +import threading from math import ceil +def mutex(m): + def wrapper(self, *args, **kwargs): + self.s.acquire() + m() + self.s.release() + return wrapper + class CannonController : def __init__(self): + self.s = threading.Semaphore() print("cannon controller started") self.position = [0, 0] self.fired = False |