brightness measurement
This commit is contained in:
parent
956e9fc41a
commit
78692904d1
@ -138,10 +138,12 @@ static void prepareTxFrame( uint8_t port )
|
|||||||
int32_t co2con;
|
int32_t co2con;
|
||||||
int32_t temp;
|
int32_t temp;
|
||||||
int32_t hum;
|
int32_t hum;
|
||||||
|
int32_t bri;
|
||||||
} values;
|
} values;
|
||||||
float co2con = 0.0;
|
float co2con = 0.0;
|
||||||
float temp = 0.0;
|
float temp = 0.0;
|
||||||
float hum = 0.0;
|
float hum = 0.0;
|
||||||
|
|
||||||
int16_t error = sensor.blockingReadMeasurementData(co2con, temp, hum);
|
int16_t error = sensor.blockingReadMeasurementData(co2con, temp, hum);
|
||||||
if (error != NO_ERROR) {
|
if (error != NO_ERROR) {
|
||||||
values.status = 0;
|
values.status = 0;
|
||||||
@ -154,6 +156,8 @@ static void prepareTxFrame( uint8_t port )
|
|||||||
values.temp = temp * 100;
|
values.temp = temp * 100;
|
||||||
values.hum = hum * 100;
|
values.hum = hum * 100;
|
||||||
}
|
}
|
||||||
|
values.bri = analogRead(6);
|
||||||
|
|
||||||
Serial.print("status: ");
|
Serial.print("status: ");
|
||||||
Serial.print(values.status);
|
Serial.print(values.status);
|
||||||
Serial.print("\t");
|
Serial.print("\t");
|
||||||
@ -165,6 +169,9 @@ static void prepareTxFrame( uint8_t port )
|
|||||||
Serial.print("\t");
|
Serial.print("\t");
|
||||||
Serial.print("humidity: ");
|
Serial.print("humidity: ");
|
||||||
Serial.print(hum);
|
Serial.print(hum);
|
||||||
|
Serial.print("\t");
|
||||||
|
Serial.print("brightness: ");
|
||||||
|
Serial.print(values.bri);
|
||||||
Serial.println();
|
Serial.println();
|
||||||
|
|
||||||
appDataSize = sizeof(values);
|
appDataSize = sizeof(values);
|
||||||
@ -244,6 +251,8 @@ void setup() {
|
|||||||
pinMode(7, OUTPUT);
|
pinMode(7, OUTPUT);
|
||||||
tone(7, 1000, 500);
|
tone(7, 1000, 500);
|
||||||
|
|
||||||
|
pinMode(6, INPUT);
|
||||||
|
|
||||||
Wire1.begin(41, 42, 10000);
|
Wire1.begin(41, 42, 10000);
|
||||||
//sensor.begin(Wire, SCD30_I2C_ADDR_61);
|
//sensor.begin(Wire, SCD30_I2C_ADDR_61);
|
||||||
sensor.begin(Wire1, 0x61);
|
sensor.begin(Wire1, 0x61);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user