Skip to content

Files

Latest commit

Ard ScheirlynckArd Scheirlynck
Ard Scheirlynck
and
Ard Scheirlynck
Jan 22, 2017
0d6a88b · Jan 22, 2017

History

History
30 lines (20 loc) · 748 Bytes

Led_gpio.md

File metadata and controls

30 lines (20 loc) · 748 Bytes

Raspberry Pi GPIO control (led example)

Based on raspberry pi tutorials and tested on the pi zero.

Physical pin layout

Use a standard led and 220 Ohm resistor.

Image of led pin layout

The pin layout on the zero is the same as bigger models can be observed here:

Image of zero layout

Code implementation

import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(18,GPIO.OUT)
print "LED on"
GPIO.output(18,GPIO.HIGH)
time.sleep(1)
print "LED off"
GPIO.output(18,GPIO.LOW)

and run

sudo python LED.py