Skip to content

Commit

Permalink
fix humidity readings conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
devbis committed Oct 27, 2023
1 parent 7644dcc commit fa59e17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/shtv3_sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void read_sensor(s16 *temp, u16 *humi) {
send_i2c(i2c_address_sensor,sens_sleep, sizeof(sens_sleep));

*temp = (s16)(((17500 * ((u32)read_buff[0] << 8 | (u32)read_buff[1])) >> 16) - 4500);
*humi = (u16)(10000 * ((u32)read_buff[3] << 8 | (u32)read_buff[4])) >> 16;
*humi = (u16)((10000 * ((u32)read_buff[3] << 8 | (u32)read_buff[4])) >> 16);

}else if(sensor_version == 1){
send_i2c(i2c_address_sensor,measure_cmd, sizeof(measure_cmd));
Expand Down
2 changes: 1 addition & 1 deletion src/version_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#endif

#define APP_RELEASE 0x10//app release 1.0
#define APP_BUILD 0x03//app build 01
#define APP_BUILD 0x04//app build 04
#define STACK_RELEASE 0x30//stack release 3.0
#define STACK_BUILD 0x01//stack build 01

Expand Down

0 comments on commit fa59e17

Please sign in to comment.