Skip to content

Instantly share code, notes, and snippets.

@ks-t0
Last active November 1, 2015 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ks-t0/b152d6a85d2d9eb16972 to your computer and use it in GitHub Desktop.
Save ks-t0/b152d6a85d2d9eb16972 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
#
# ライブラリ呼び出し部
import RPi.GPIO as GPIO # GPIOライブラリを呼び出し
import time # 時間関連のライブラリを呼び出し
# 初期設定部
GPIO.setmode( GPIO.BOARD ) # GPIOを端子番号で指定する
GPIO.setup( 16, GPIO.OUT ) # 16番端子を出力に設定する
# プログラム本体
while True: # 繰り返しを行う
 GPIO.output( 16, GPIO.HIGH ) # LEDを点灯する
 time.sleep(1) # 1秒待機する
 GPIO.output( 16, GPIO.LOW ) # LEDを消灯する
time.sleep(1) # 1秒待機する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment