#include <Wire.h> //这个是iic需要
#include <SPI.h> //SD卡要
#include <SD.h>
#include "Adafruit_Si7021.h" //温度湿度传感器,这里可能式<>符号
#include <BH1750FVI.h> //光传感器
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
/* * SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK/sck - pin 13
** CS - pin 4 (片选信号管脚,可以改变)
SD卡需要格式化为FAT32或FAT16格式,电源电压4.5-5.5v 电流0.2-200ma
*/
const int chipSelect = 4; //SD卡片选型号脚
Adafruit_Si7021 sensor = Adafruit_Si7021(); //实化Si7021
BH1750FVI LightSensor(BH1750FVI::k_DevModeContLowRes); //光传感器
Adafruit_BMP280 bme;
String TimeString = ""; // 记录时间的字符串
bool stringComplete = false; // whether the string is complete
bool flag = false;
void setup() {
Serial.begin(115200);
TimeString.reserve(200); // 如何写了这
Arduino气象站代码(版本一)
最新推荐文章于 2022-03-02 14:24:38 发布