feat: 全量同步 254 个常用的 Arduino 扩展库文件

This commit is contained in:
yczpf2019
2026-01-24 16:05:38 +08:00
parent c665ba662b
commit 397b9a23a3
6878 changed files with 2732224 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
/*
Example of BH1750 library usage.
This example initialises the BH1750 object using the high resolution
one-time mode and then makes a light level reading every second.
The BH1750 component starts up in default mode when it next powers up.
The BH1750 library automatically reconfigures the one-time mode in
preparation for the next measurement.
*/
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
void setup(){
Serial.begin(9600);
// Initialize the I2C bus (BH1750 library doesn't do this automatically)
Wire.begin();
// On esp8266 you can select SCL and SDA pins using Wire.begin(D4, D3);
lightMeter.begin(BH1750::ONE_TIME_HIGH_RES_MODE);
Serial.println(F("BH1750 One-Time Test"));
}
void loop() {
float lux = lightMeter.readLightLevel();
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lx");
delay(1000);
}