Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !/usr/bin/python
- import gpiod
- import time
- #def id_btn():
- line_index=32
- #chip=gpiod.Chip('gpiochip0')
- #pin=chip.get_lines([line_index])
- #pin.request(consumer="id0",type=gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
- # state=pin.get_values()[0]
- # if(state=='1'):
- # pin.set_values([0])
- # return 'red'
- # else:
- # pin.set_values([1])
Advertisement
Add Comment
Please, Sign In to add comment