orsjb / HappyBrackets

HappyBrackets is an audio-focused library and toolkit for creative coding for the internet of things.
Apache License 2.0
36 stars 3 forks source link

Temperature output on HTS221 #53

Open angelofraietta opened 6 years ago

angelofraietta commented 6 years ago

The HTS221 is showing a value of -2850, so we need to find out what temperature really is

    HTS221 mySensor = (HTS221) hb.getSensor(HTS221.class);

    DynamicControl control_temp = hb.createDynamicControl(ControlType.FLOAT, "Temperature");

    if (mySensor != null) {
        mySensor.addListener(new SensorUpdateListener() {

            @Override
            public void sensorUpdated() {

                control_temp.setValue(mySensor.getTemperatureData());
            }
        });
    }
}
angelofraietta commented 6 years ago

Need to add conversions. See http://www.st.com/content/ccc/resource/technical/document/technical_note/group0/82/97/c8/ab/c6/da/41/ed/DM00208001/files/DM00208001.pdf/jcr:content/translations/en.DM00208001.pdf