Relative Content

Daily Archives: 2017年11月5日

WeMos (c6) Thingspeak

数回JSON関連の実験をしたが、いざTinyWebDBのAPIの実験を始まると、また引っかかるところが多い。 色々と検索してところ、ThingspeakのAPIサンプルが見つかったので、ちょっと曲がり道して試すことに。 センサーの温度と気圧をThingspeakにアップして、動きを見て見る。 まずThingspeakのアカウントを申請して、THINGSPEAK_API_KEYを取得する。 https://thingspeak.com/users/sign_up 次はサンプルを見ながら、プログラミング。 #include <Adafruit_BMP280.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define OLED_RESET 0 // GPIO0 Adafruit_SSD1306 OLED(OLED_RESET); #define BMP_SCK 13 #define BMP_MISO 12 #define BMP_MOSI 11 #define BMP_CS 10 Adafruit_BMP280 bmp; // I2C //Adafruit_BMP280 bmp(BMP_CS); // hardware SPI //Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK); #include <ESP8266WiFi.h> #include <ESP8266HTTPClient.h> /*************************** * Begin Settings **************************/ const […]