Giter Site home page Giter Site logo

raspi_weather_notify's Introduction

raspi_weather_notify

Raspberry PI2 model bとフルカラーLEDを使用して 今日の天気の降水確率を色で表します。

  • 80%以上は赤
  • 50%以上は黄
  • 30%以上は青
  • 20%以上はシアン
  • 20%未満は消灯

使い方

必要機器

  • 角型フルカラーLED 型番:OSTA71A1D-A
  • 5Ω抵抗x2
  • 65Ω抵抗x1
  • あとはブレッドボードその他

接続

  • REDカソードは65Ωの抵抗を経由してGPIO18(ピン番号12)
  • BLUEカソードは5Ωの抵抗を経由してGPIO13(ピン番号33)
  • GREENカソードは5Ωの抵抗を経由してGPIO19(ピン番号35)
  • アノードはGND(ピン番号9)

必要ライブラリのインストール

GPIOモジュールをインストール

$ sudo apt-get install python-rpi.gpio

pywapiをインストール

https://launchpad.net/python-weather-api/trunk/0.3.8/+download/pywapi-0.3.8.tar.gz をダウンロードして展開後、

$ python setup.py build

$ python setup.py install

このプログラムをインストール

cd /home/pi/

git clone https://github.com/kiwamaru/raspi_weather_notify.git

CRONへ登録

$ sudo crontab -e

*/5 * * * * sudo python /home/pi/raspi_weather_notify/weather.py

パラメータの解説

get_weather_from_weather_com('xxxx') で地域コードを指定する。

地域コードの調べ方

www.weather.comにて地域を入力すると、以下のようにURLの末尾が地域コードとなる。

http://www.weather.com/weather/today/l/JAXX0085:1:JA

'JAXX0085:1:JA'は東京の地域コード

関連情報

参考サイト

raspi_weather_notify's People

Contributors

kiwamaru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.