Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Push the button

jn_wp Apr 7th, 2020 150 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from gpiozero import LED, Button
  2. from time import sleep
  3.  
  4. red_led = LED(17)
  5. button = Button(4)
  6.  
  7. red_led.on()
  8. sleep(1)
  9. red_led.off()
  10.  
  11. while True:
  12.     if button.is_pressed:
  13.         print('Button pressed!')
  14.         red_led.on()
  15.         sleep(0.5)
  16.     else:
  17.         red_led.off()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top