How can I change the temperature unit for sensor BMP180 unsing Raspberry PI?

2 ビュー (過去 30 日間)
Susanne Mai
Susanne Mai 2016 年 8 月 1 日
回答済み: Ilyas Saytashev 2017 年 3 月 28 日
I started working with the temperature sensor BMP180 connected to a Raspberry Pi 2. I'm using the Raspberry toolbox so I created a raspi object called mypi and a bmp object with
bmp = raspi.internal.bmp180(mypi, 'i2c-1')
now I can go on with
temperature = readTemperature(bmp)
but now I want to change the temperature unit from "Celsius" to "Kelvin". How can I do that? I found
set.TemperatureUnit(obj, value)
in the bmp180.m but can not run it successfully. The image showes what I have tried

回答 (1 件)

Ilyas Saytashev
Ilyas Saytashev 2017 年 3 月 28 日
Have you opened bmp structure and were you able to locate "TemperatureUnit"? I'm afraid there is no such a variable and you might want to convert C to K mathematically: temperature_K=temperature+273; Best regards.

カテゴリ

Help Center および File ExchangeMATLAB Support Package for Raspberry Pi Hardware についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by