obniz Parts Library

TR4

GitHub
TR4
Usable Devices :
obniz_board
m5stickc
obnizble
esp32
esp32gateway
m5stackbasic
ak-030
obnizble_lte
obniz_plc

Tr4

This is a series of temperature sensors for BLE communication manufactured by T and D.
It supports TR41, TR42, and TR45.

getData

Get the data from advertisement.

Results can be retrieved in the following format

{
  temperature: Temperature [degrees];
}
// Javascript Example
const tr4 = Obniz.getPartsClass('TR4');
await obniz.ble.initWait();
obniz.ble.scan.onfind = (p) => {
    if (tr4.isDevice(p)) {
        const data = tr4.getData(p);
        console.log(data);
    }
};
await obniz.ble.scan.startWait(null, { duplicate: true, duration: null });

Supported from: obniz.js 3.17.0