Change NCIR 2 from C to F
-
How would I go about changing the NCIR 2 unit to read from celsius to fahrenheit? Any help would be great
-
Hello @reptilepvp
according to its datasheet the used sensor MLX90614 is Celsius only.
That said, there is a quite simple formula to convert Celsius into Fahrenheit. Have you tied that?
(0 °C × 9/5) + 32 = 32 °F
Thanks
Felix -
@felmue I apologize for sounding stupid & not doing my research. But could you possiblely show me where I need to put that in my code? I thought I put the formula in right. But I guess not .
i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000)
ncir2_0 = NCIR2Unit(i2c0, 0x5A)
ncir2_0.set_buzzer_control(0)
ncir2_0.set_rgb_led(0xcc33cc)
ncir2_0.set_emissivity_value(0.95)def loop():
global DopeMete, Battery, Temperature, label5, label0, line0, label1, line2, label2, line1, label3, label4, i2c0, ncir2_0
M5.update()
label2.setText(str("%.2f"%float((((ncir2_0.get_temperature_value) * 9) / 5 + 32))))
label3.setText(str(ncir2_0.get_emissivity_value))
label4.setText(str(ncir2_0.get_button_status))
label5.setText(str(Power.getBatteryLevel())) -
Hello @reptilepvp
just try something like below:
label2.setText(str(((ncir2_0.get_temperature_value) * 9) / 5 + 32))Note: untested as I do not have the necessary hardware to verify.
Thanks
Felix
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login