forked from gitlaura/get_tweets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sliceoftrumppi.py
60 lines (47 loc) · 1000 Bytes
/
sliceoftrumppi.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import time
import RPi.GPIO as GPIO
from papirus import Papirus
from papirus import PapirusText
SW1 = 26
SW2 = 19
SW3 = 20
SW4 = 16
SW5 = 21
def main()
screen.clear()
GPIO.setmode(GPIO.BCM)
GPIO.setup(SW1, GPIO.IN)
GPIO.setup(SW2, GPIO.IN)
GPIO.setup(SW3, GPIO.IN)
GPIO.setup(SW4, GPIO.IN)
GPIO.setup(SW5, GPIO.IN)
refresh()
while True;
if GPIO.input(SW1) == False:
if num > maxNum:
num + 1
tweet = tweets[num]
text.write(tweet,13)
if GPIO.input(SW2) == False:
if num > 0:
num - 1
tweet = tweets[num]
text.write(tweet,13)
if GPIO.input(SW3) == False:
text.write('Refreshing tweets.')
refresh()
if GPIO.input(SW5) == False:
text.write('Shutting down.')
time.sleep(2)
screen.clear()
os.system("sudo shutdown now")
def refresh()
tweets = get_tweets(realDonaldTrump)
num = 0
maxNum = len(tweets)
tweet = tweets[num]
text.write(tweet,13)