Code Monkey home page Code Monkey logo

esptempbme280's Introduction

ESPTempBME280

ESP8266をWifi経由WWWサーバとして起動し、BME280から温度・湿度・気圧を読み取るテスト。

使い方

  1. ブレッドボードにESP8266とBME280を挿し、以下のように結線する。
    ESP8266:GND   ----  GND:BME280
    ESP8266:3.3V  ---- 3.3V:BME280
    ESP8266:GPIO4 ----  SDA:BME280
    ESP8266:GPIO5 ----  SCL:BME280
  1. ESPTempBME280.ino の以下を修正し、SSIDとパスワードを設定する。
    const char *ssid = "YOUR_SSID";
    const char *password = "YOUR_PASSWORD";
  1. 固定IPで起動したい場合は、以下も修正する。
    // #define USE_FIXED_IP
    #if defined(USE_FIXED_IP)
    IPAddress ip(192, 168, 2, 222);
    IPAddress gateway(192, 168, 2, 2);
    IPAddress subnet(255, 255, 255, 0);
    #endif
  1. 以下からArduino用BME280ライブラリを取得し、BME280_MOD-1022.cpp とBME280_MOD-1022.h を ESPTempBME280.ino と同じフォルダに設置する。ソースはArduino用だが、ESP8266でも使用可能。
    https://github.com/embeddedadventures/BME280
  1. Arduino IDEを起動して ESPTempBME280.ino を読み、ターゲットボードに"Generic ESP8266 Module"を、書き込み装置に"AVR ISP"を選び、ビルド・転送する。

  2. ESP8266を起動すると、シリアルコンソールに取得したIPアドレスが出力される。

  3. http://[ip-address]/ にアクセスし、「Hello from ESP8266!」が表示されることを確認する。

  4. http://[ip-address]/temp.txt にアクセスし、気温・湿度・気圧が表示されることを確認する。

ライセンス

本プロダクトは、自由かつ無償で使用・コピー・配布・変更・流用を行うことができます。また許可なく再配布・出版・販売を行うことができます。
本プロダクトは、無保証です。使用した、あるいはしなかったことによる一切の責任は使用者にあるものとします。

連絡先

後藤 浩昭 / GORRY
http://GORRY.hauN.org/
twitter/gorry5

esptempbme280's People

Contributors

gorry 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.