Menu
Home
People
Places
Arts
History
Plants & Animals
Science
Life & Culture
Technology
Reference.org
PreonVM
open-in-new
Code example
The following code examples uses an SHT21 sensor and reads the relative humidity.
public class SHT21Demo { public static void main(String[] args) { // sensor is connected to I2C bus instance 1 NativeI2C i2c = NativeI2C.getInstance(1); i2c.open(); // create and init SHT21 sensor instance SHT21 sht21 = new SHT21(i2c); sht21.setResolution(SHT21.RESOLUTION_RH12_T14); sht21.reset(); // read and print humidity every second while (true) { sht21.startRelativeHumidityConversion(); Thread.sleep(100); int rawRH = sht21.getRelativeHumidityRaw(); float rh = SHT21.convertRawRHToRHw(rawRH); System.out.println("SHT21: rawRH=" + rawRH + "; RH=" + rh); Thread.sleep(900); } } }
See also
List of Java virtual machines
External links
PreonVM site
Handbook of Industry 4.0 and SMART Systems
- mentions the PreonVM as OS for
WSN
Intelligent container
- uses PreonVM operated radio module
Synchronous data acquisition with wireless sensor networks
- mentions the PreonVM as option
Scalable Web Technology for the Internet of Things
- mentions the PreonVM to run the CoAP framework