Last active
December 15, 2015 22:29
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
ありがとう!