We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Below freezing point I got readings of 255.82, which is obviously incorrect. I tried this, and it seems fine:
diff --git a/src/pcsensor.c b/src/pcsensor.c index 56fb787..31018a2 100644 --- a/src/pcsensor.c +++ b/src/pcsensor.c @@ -258,7 +258,7 @@ void interrupt_read(usb_dev_handle *dev) { void interrupt_read_temperatura(usb_dev_handle *dev, float *tempC) { int r,i, temperature; - unsigned char answer[reqIntLen]; + char answer[reqIntLen]; bzero(answer, reqIntLen); r = usb_interrupt_read(dev, 0x82, answer, reqIntLen, timeout); @@ -274,9 +274,9 @@ void interrupt_read_temperatura(usb_dev_handle *dev, float *tempC) { printf("\n"); } - temperature = (answer[3] & 0xFF) + (answer[2] << 8); + temperature = (answer[3] & 0xFF) | (answer[2] << 8); temperature += calibration; - *tempC = temperature * (125.0 / 32000.0); + *tempC = temperature / 256.0; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Below freezing point I got readings of 255.82, which is obviously incorrect.
I tried this, and it seems fine:
The text was updated successfully, but these errors were encountered: