查看您可以使用
的文档model.findAll({where: {attribute: x}}).但是,我想选择所有非x的属性.我在这里寻找一个正则表达式,但这似乎不是一个最佳解决方案.
做这个的最好方式是什么?
我试图让这些 GPIO 端口同时打开和关闭,但在 RPi 上的间隔不同。我可以运行其中一个循环并且它可以工作,但是当我引入线程时它却没有。
import RPi.GPIO as GPIO
from time import sleep
import thread
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)
GPIO.setup(13, GPIO.OUT)
GPIO.setup(15, GPIO.OUT)
def fast():
while True:
GPIO.output(11, True)
sleep(.02)
GPIO.output(11, False)
sleep(.02)
def med():
while True:
GPIO.output(13, True)
sleep(.2)
GPIO.output(13, False)
sleep(.2)
def slow():
while True:
GPIO.output(15, True)
sleep(2)
GPIO.output(15, False)
sleep(2)
thread.start_new_thread(fast,())
thread.start_new_thread(med,())
thread.start_new_thread(slow,())
Run Code Online (Sandbox Code Playgroud)