def lightTagHandler(v, t, a):
     if v:
         flash.on()
     else:
         try:
             flash.off()
         except Exception as e:
             print(e)
         flash.release()
示例#2
0
文件: main.py 项目: susmit/plyer
 def turn_on(self):
     flash.on()
示例#3
0
import kivy
from plyer import flash, vibrator
from time import sleep

from MorseCode import *

flashTime = 0.2

mes = "hello world"

signal = toSignal(encode(mes))

print(signal)

for char in signal:
    if char == "1":
        flash.on()
        vibrator.vibrate(time=flashTime)
    elif char == "0":
        flash.off()

    sleep(flashTime)

flash.off()