summaryrefslogtreecommitdiffstats
path: root/Lasers_und_stuff/Cannon.py
diff options
context:
space:
mode:
authorSergiusz Bazański <q3k@q3k.org>2012-11-11 13:35:07 +0100
committerSergiusz Bazański <q3k@q3k.org>2012-11-11 13:35:07 +0100
commit1ab422118cfacee567725e0f1244a66f30350e6d (patch)
treee55b1c97c407385fefca70e770d46df640b719ba /Lasers_und_stuff/Cannon.py
parent318fe0a9094b2624761d2f6f8de8f491305145bc (diff)
downloadlaserz_und_stuff-1ab422118cfacee567725e0f1244a66f30350e6d.tar.gz
laserz_und_stuff-1ab422118cfacee567725e0f1244a66f30350e6d.tar.bz2
laserz_und_stuff-1ab422118cfacee567725e0f1244a66f30350e6d.tar.xz
laserz_und_stuff-1ab422118cfacee567725e0f1244a66f30350e6d.zip
Basic web control.
Diffstat (limited to 'Lasers_und_stuff/Cannon.py')
-rw-r--r--Lasers_und_stuff/Cannon.py9
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