Skip to content

Commit

Permalink
Create mk2.py
Browse files Browse the repository at this point in the history
  • Loading branch information
horiq-asm authored Feb 14, 2024
1 parent e6bb2cf commit a62406b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mk2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python
#encoding: utf8

import pigpio, time # ライブラリのインポート

gpio_up = 4 # LED を接続した GPIO

pi = pigpio.pi() # GPIOにアクセスするためのインスタンスを作成
pi.set_mode(gpio_up,pigpio.OUTPUT) # GPIO pin を出力設定

pi.write(gpio_up,1) # フォトカプラSWON
time.sleep(0.5) # 0.5s ウェイト
pi.write(gpio_up,0) # フォトカプラSWOFF
pi.stop() # pigpio リソースの開放

0 comments on commit a62406b

Please sign in to comment.