GR-ADZUKI BME280

Pocket

GR-ADZUKIに温湿度センサBME280を接続しました。
BME280使用 温湿度・気圧センサモジュールキット
http://akizukidenshi.com/catalog/g/gK-09421/
SPIとI2Cに対応していますが今回は、SPIを使用しました。
BME280のライブラリには以下のサイトを使用しました。
https://github.com/adafruit/Adafruit_BME280_Library
Adafruit_BME280.cpp
Adafruit_BME280.h
https://github.com/adafruit/Adafruit_Sensor
Adafruit_Sensor.h
上の3つのファイルをプロジェクトに入れます。
SPIは、SPI2側を使用しました。ピンを割り当てます。
#define BME_SCK 30
#define BME_MISO 29
#define BME_MOSI 28
#define BME_CS 27
SPIを使用するので若干コードを変更します。
宣言は、SPI用を使用します。
Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK);
初期化もSPIを用を使用しました。
status = bme.init();

シリアルモニタに温度、湿度、気圧が表示できました。
サンプルプログラムは以下にあります。
https://github.com/jendo1969/GR-ADZUKI2/blob/master/bme280test/Adafruit_BME280.cpp

The temperature and humidity sensor BME 280 was connected to GR-ADZUKI.
BME 280 Operating temperature / humidity / atmospheric pressure sensor module kit

http://akizukidenshi.com/catalog/g/gK-09421/
It corresponds to SPI and I2C, but this time I used SPI.
I used the following site in the library of BME 280.

https://github.com/adafruit/Adafruit_BME280_Library
Adafruit_BME280.cpp
Adafruit_BME280.h
https://github.com/adafruit/Adafruit_Sensor
Adafruit_Sensor.h
Put the above three files into the project.
SPI used SPI 2 side. Assign pins.
#define BME_SCK 30
#define BME_MISO 29
#define BME_MOSI 28
#define BME_CS 27
I will change the code slightly because I use SPI.
Declaration uses for SPI.

Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK);
Initialization also used for SPI.
status = bme.init();
Temperature, humidity, pressure were displayed on the serial monitor.
The sample program is below.

https://github.com/jendo1969/GR-ADZUKI2/blob/master/bme280test/Adafruit_BME280.cpp

溫度和濕度傳感器BME 280連接到GR-ADZUKI。
BME 280工作溫度/濕度/大氣壓力傳感器模塊套件

http://akizukidenshi.com/catalog/g/gK-09421/
它對應於SPI和I2C,但這次我使用了SPI。
我在BME 280庫中使用了以下站點。

https://github.com/adafruit/Adafruit_BME280_Library
Adafruit_BME280.cpp
Adafruit_BME280.h
https://github.com/adafruit/Adafruit_Sensor
Adafruit_Sensor.h
將上述三個文件放入項目中。
SPI使用SPI 2端。 分配引腳。

#define BME_SCK 30
#define BME_MISO 29
#define BME_MOSI 28
#define BME_CS 27
我會稍微更改代碼,因為我使用SPI。
聲明用於SPI。

Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK);
初始化也用於SPI。
status = bme.init();
溫度,濕度,壓力顯示在串行監視器上。
示例程序如下。

https://github.com/jendo1969/GR-ADZUKI2/blob/master/bme280test/Adafruit_BME280.cpp

Post Tagged with , , ,

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください