Пример #1
0
    def transfer(self, data):
        start = time()
        now = time()
        while now - start < 0.5:
            on = chargetimes.getLedResistor(receiveRate)
            if on:
                start = time()
            else:
                now = time()

        self.an2led(data, sendRate)
Пример #2
0
 def transfer(self, data):
     start=time()
     now = time()
     while now-start < 0.5:
         on = chargetimes.getLedResistor(receiveRate)
         if on:
             start=time()
         else:
             now = time()
             
     self.an2led(data, sendRate)
Пример #3
0
import ledOnOff
import chargetimes
import time

ledOnOff.on()
time.sleep(0.001)
print("Detect LED 'on': " + str(chargetimes.getLedResistor()))

ledOnOff.off()
time.sleep(0.001)
print("Detect LED 'off': " + str(not chargetimes.getLedResistor()))
Пример #4
0
 def receiveResistor(self):
     on = chargetimes.getLedResistor(receiveRate)
     return self.addOne(on, time())
Пример #5
0
 def receiveResistor(self):
     on = chargetimes.getLedResistor(receiveRate)
     return self.addOne(on, time())