From a0b18c1414ab1d4645d4201a426258af072c5199 Mon Sep 17 00:00:00 2001 From: troj Date: Tue, 17 Feb 2015 07:45:20 +0000 Subject: [PATCH] Commit rasp --- thread_dd.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+), 0 deletions(-) create mode 100644 thread_dd.py diff --git a/thread_dd.py b/thread_dd.py new file mode 100644 index 0000000..00e1d53 --- /dev/null +++ b/thread_dd.py @@ -0,0 +1,58 @@ +from threading import Thread +import time +from RPi import GPIO + +class DD(Thread): + + #Constructeur + def __init__(self, pin, t_notes, t_tps): + Thread.__init__(self); + self.pin = pin + self.t_notes = t_notes + self.t_tps = t_tps + + def run(self): + p = GPIO.PWM(self.pin,220) + p.start(15) + i = 0 + while(i