Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 support for scd30.py, wiring example, root comment for installing clock stretching and more Readme. #3

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

servetcoskun
Copy link

No description provided.

@servetcoskun servetcoskun changed the title wiring example, run as root comment for installing clock stretching and more. python3 support for scd30.py, wiring example, root comment for installing clock stretching and more Readme. Mar 4, 2019
@species species self-assigned this Mar 18, 2019
float_T = struct.unpack('>f', struct_T)

struct_rH = struct.pack('>BBBB', data[12], data[13], data[15], data[16])
float_rH = struct.unpack('>f', struct_rH)[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you add [0] for float_co2 and float_rH, but not for float_T - is there any difference?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will test, but I think it was because the co2 and rh returned a list while the temperature returned a single value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm - the data format is exactly the same for all three... and struct.unpack('>f', ... ) should return a single float every time...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that makes sense, I will have time to test today and will put the output of the code here later.

Copy link
Author

@servetcoskun servetcoskun Mar 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should definitely be a [0] for temperature as well, you are right :)

struct_co2 = struct.pack('>BBBB', data[0], data[1], data[3], data[4])
float_co2 = struct.unpack('>f', struct_co2)[0]

struct_T = struct.pack('>BBBB', data[6], data[7], data[9], data[10])
float_T = struct.unpack('>f', struct_T)[0]

struct_rH = struct.pack('>BBBB', data[12], data[13], data[15], data[16])
float_rH = struct.unpack('>f', struct_rH)[0]

that is the correct way to do it.

@servetcoskun servetcoskun marked this pull request as draft November 15, 2020 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants