Skip to content

Instantly share code, notes, and snippets.

@basuke
Last active December 15, 2015 22:29
Show Gist options
  • Save basuke/5333668 to your computer and use it in GitHub Desktop.
Save basuke/5333668 to your computer and use it in GitHub Desktop.
Raspberry Pi with Tilt sensor test. http://www.youtube.com/watch?v=IkuUMund6rA
import pygame.mixer
from time import sleep
import RPi.GPIO as GPIO
from sys import exit
GPIO.setmode(GPIO.BCM)
GPIO.setup(24, GPIO.IN)
print "Ready."
while True:
try:
if GPIO.input(24):
print "HIGH"
else:
print "LO"
sleep(1)
except KeyboardInterrupt:
exit()
@fgutz
Copy link

fgutz commented Jan 20, 2014

Hi Basuke,
Could you tell me a little more about how you got this to work? Can you list all the parts you used and where to connect on the Pi board?

ありがとう!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment