Теперь такой вывод
OUT1
set OUT 3 = 1
set OUT 5 = 1
set OUT 11 = 1
set OUT 12 = 1
set OUT 13 = 1
set OUT 15 = 1
set OUT 16 = 1
set OUT 18 = 1
set OUT 19 = 1
set OUT 21 = 1
set OUT 22 = 1
set OUT 23 = 1
OUT0
wait
скрипт исправил
while True:
print("OUT1")
cursor = db.cursor()
w = cursor.execute("SELECT numb FROM gpio WHERE type='out' and value=1")
cursor.execute("SELECT numb FROM gpio WHERE type='out' and value=1")
data = cursor.fetchall()
for d in range(w):
row = data[d]
idleg = row[0]
GPIO.output(idleg, 1)
print("set OUT", idleg, "= 1")
del row
del idleg
del data
del cursor
del w
print("OUT0")
cursor = db.cursor()
w = cursor.execute("SELECT numb FROM gpio WHERE type='out' and value=0")
cursor.execute("SELECT numb FROM gpio WHERE type='out' and value=0")
data = cursor.fetchall()
for d in range(w):
row = data[d]
idleg = row[0]
GPIO.output(idleg, 0)
print("set OUT", idleg, "= 0")
del row
del idleg
del data
del cursor
del w
time.sleep(2)
print("wait")
в БД поставил значения поля value=0 на 3 и 15 numb