1 Star 0 Fork 0

杨雪元/raspberrypi_cookbook_ed2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
twitter_trigger.py 486 Bytes
一键复制 编辑 原始数据 按行查看 历史
Simon Monk 提交于 2016-02-05 12:16 . added lots of code
#!/usr/bin/env python
import time
import dweepy
import RPi.GPIO as GPIO
KEY = 'tweet_about_me'
OUTPUT_PIN = 18
OUTPUT_DURATION = 10
GPIO.setmode(GPIO.BCM)
GPIO.setup(OUTPUT_PIN, GPIO.OUT)
while True:
try:
for dweet in dweepy.listen_for_dweets_from(KEY):
print('Tweet: ' + dweet['content']['text'])
GPIO.output(OUTPUT_PIN, True)
time.sleep(OUTPUT_DURATION)
GPIO.output(OUTPUT_PIN, False)
except Exception:
pass
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yang_xueyuan/raspberrypi_cookbook_ed2.git
git@gitee.com:yang_xueyuan/raspberrypi_cookbook_ed2.git
yang_xueyuan
raspberrypi_cookbook_ed2
raspberrypi_cookbook_ed2
master

搜索帮助