def init():
print(lirc_device)
wiringpi.wiringPiSetup()
wiringpi.pinMode(A_1_PIN,INPUT)
wiringpi.pullUpDnControl(A_1_PIN,PUD_UP)
wiringpi.pinMode(B_1_PIN,INPUT)
wiringpi.pullUpDnControl(B_1_PIN,PUD_UP)
wiringpi.pinMode(BTN_1_PIN,INPUT)
wiringpi.pullUpDnControl(BTN_1_PIN,PUD_UP)
wiringpi.pinMode(A_2_PIN,INPUT)
wiringpi.pullUpDnControl(A_2_PIN,PUD_UP)
wiringpi.pinMode(B_2_PIN,INPUT)
wiringpi.pullUpDnControl(B_2_PIN,PUD_UP)
wiringpi.pinMode(BTN_2_PIN,INPUT)
wiringpi.pullUpDnControl(BTN_2_PIN,PUD_UP)
wiringpi.pinMode(POWER_PIN,INPUT)
wiringpi.pullUpDnControl(POWER_PIN,PUD_UP)
thread.start_new_thread(encoder_loop, ())
thread.start_new_thread(keypressd, (lirc_device, ))
评论列表
文章目录