Blink Led

raspberry pi raspberrypi stem
Created on 2017-10-16 Last Modified 2018-08-30


Introduction

Making Blinking LED is just like writing a hello world programme in engineering.

Setting

setting

Python Code

import RPi.GPIO as GPIO
import time

LED = 18
GPIO.setmode(GPIO.BCM)
GPIO.set(LED, GPIO.OUT)
GPIO.setwarnings(False)

print("Programme start.")
GPIO.output(LED, True)
time.sleep(0.5)
GPIO.output(LED, False)
time.sleep(0.5)
print("Programme closed.")

comments powered by Disqus