gaston0902

Untitled

Aug 21st, 2023
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. !/usr/bin/python
  2. import gpiod
  3. import time
  4.  
  5.  
  6. #def id_btn():
  7. line_index=32
  8. #chip=gpiod.Chip('gpiochip0')
  9. #pin=chip.get_lines([line_index])
  10. #pin.request(consumer="id0",type=gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
  11. # state=pin.get_values()[0]
  12. # if(state=='1'):
  13. # pin.set_values([0])
  14. # return 'red'
  15. # else:
  16. # pin.set_values([1])
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment