-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreen.py
More file actions
executable file
·46 lines (36 loc) · 889 Bytes
/
screen.py
File metadata and controls
executable file
·46 lines (36 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python
# encoding: utf-8
"""
screen.py
this tests the pygame functions to display a number of screen graphics.
Created by Joseph on 2014-10-11.
Copyright (c) 2014 Gray Squared. All rights reserved.
"""
import sys, os
#from time import sleep
#import pygame
from platform import system, machine
rpi = False
if (system() == 'Linux' and machine() == 'armv6l'):
import RPi.GPIO as GPIO
rpi = True
change = 22
end = 18
blue = 23
GPIO.setmode(GPIO.BOARD)
GPIO.setup(blue,GPIO.OUT, initial=GPIO.LOW)
blue_on, blue_off = GPIO.output(blue,1),GPIO.output(blue,0)
GPIO.setup(change,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(end,GPIO.IN, pull_up_down=GPIO.PUD_UP)
def main():
if rpi:
blue_on
person = raw_input('Enter your name: ')
print 'Hello', person
def cleanup():
if rpi:
GPIO.cleanup()
pygame.quit()
sys.exit()
if __name__ == '__main__':
main()