generated from Embedded_Projects/Pudding_LWNode_Template
Updated DHT driver, use NORMAL mode for sampling.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Signed-off-by: Yilin Sun <imi415@imi.moe>
This commit is contained in:
parent
d9cffeff06
commit
1b5868d4cb
|
@ -86,6 +86,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-common -fno-builtin -f
|
|||
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
|
||||
|
||||
set(IMSENSORS_FLOAT_SUPPORT ON CACHE BOOL "")
|
||||
|
||||
add_subdirectory(lib/sensors)
|
||||
add_subdirectory(lib/tof)
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 242625c01ba91999fa1e2505255e397a9274d099
|
||||
Subproject commit 60df7deccbf8c8fa85bf4b1a877e685b33adebaa
|
14
src/main.c
14
src/main.c
|
@ -100,7 +100,11 @@ int main(void) {
|
|||
|
||||
ims_bme280_config_t dht_cfg;
|
||||
ims_bme280_preset_config(&dht_cfg, IMS_BME280_PRESET_WEATHER);
|
||||
ims_bme280_apply_config(&s_dht, &dht_cfg);
|
||||
|
||||
dht_cfg.mode = IMS_BME280_MODE_NORMAL;
|
||||
dht_cfg.t_sb = IMS_BME280_STANDBY_TIME_500_MS;
|
||||
|
||||
ims_bme280_config(&s_dht, &dht_cfg);
|
||||
|
||||
if (ims_ltr_303als_init(&s_als) != IMS_SUCCESS) {
|
||||
goto dead_loop;
|
||||
|
@ -171,7 +175,7 @@ int main(void) {
|
|||
}
|
||||
}
|
||||
|
||||
if (ims_bme280_measure(&s_dht, &dht_result) != IMS_SUCCESS) {
|
||||
if (ims_bme280_read(&s_dht, &dht_result) != IMS_SUCCESS) {
|
||||
goto dead_loop;
|
||||
}
|
||||
|
||||
|
@ -188,9 +192,9 @@ int main(void) {
|
|||
printf(
|
||||
"T: %5.2fC,\tH: %6.2f%%,\tP: %6.2fhPa,\tI0: %6.2flx,\tI1: %6.2flx,\tT_IMU: %5.2fC\tR: %4dmm\tV: "
|
||||
"%6.2fmV\r\n",
|
||||
dht_result.temperature / 100.0, dht_result.humidity / 1024.0, dht_result.pressure / 25600.0,
|
||||
als_result.ch0_value / 48.0, als_result.ch1_value / 48.0, (imu_temp / 256.0) + 25.0,
|
||||
ranging_result.RangeMilliMeter, (vbat * VDD_VALUE / 4096.0));
|
||||
dht_result.temperature, dht_result.humidity, dht_result.pressure / 100.0f, als_result.ch0_value / 48.0,
|
||||
als_result.ch1_value / 48.0, (imu_temp / 256.0) + 25.0, ranging_result.RangeMilliMeter,
|
||||
(vbat * VDD_VALUE / 4096.0));
|
||||
}
|
||||
|
||||
dead_loop:
|
||||
|
|
Loading…
Reference in New Issue