Skip to content

Instantly share code, notes, and snippets.

@robhinds
Created February 18, 2014 14:13
Show Gist options
  • Select an option

  • Save robhinds/9071754 to your computer and use it in GitHub Desktop.

Select an option

Save robhinds/9071754 to your computer and use it in GitHub Desktop.
# import the package to control GPIO
import RPi.GPIO as GPIO
# Set mode to BCM - this allows us to reference pins by numbers labelled on the cobbler, not just the normal pin number
GPIO.setmode(GPIO.BCM)
# we connected out light to pin labelled 23, so we will store that so we can easily reference it
GREEN_LED = 23
# Setup and turn on the green light
GPIO.setup(GREEN_LED, GPIO.OUT)
GPIO.output(GREEN_LED, True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment