www.dragino.com
LSN50 LoRa Sensor Node User Manual
20
/
60
hum_SHT=(value/10).toFixed(1);//SHT20,Humidity,units:%
}
else if(mod2=="Distance")
{
value=bytes[7]<<8 | bytes[8];
var distance=(value/10) .toFixed(1); // Distance,units:cm
}
else if(mod4=="3DS18B20")
{
value=bytes[7]<<8 | bytes[8];
if(bytes[7] & 0x80)
{value |= 0xFFFF0000;}
var tempc2=(value/10).toFixed(2);//DS18B20,PB3,units:
℃
value=bytes[9]<<8 | bytes[10];
if(bytes[9] & 0x80)
{value |= 0xFFFF0000;}
var tempc3=(value/10).toFixed(2);//DS18B20,PB3,units:
℃
}
}
return {
BatV:batV,
TempC1:tempc1,
TempC2:tempc2,
TempC3:tempc3,
ADC_CH0V:adc_ch0,
ADC_CH1V:adc_ch1,
ADC_CH4V:adc_ch4,
Digital_IStatus:digital_IS,
EXTI_Trigger:exti_trigger,
Door_status:switch_,
MOD1:mod1,
MOD2:mod2,
MOD3:mod3,
MOD4:mod4,
Distance: distance,
TempC_SHT:temp_SHT,
Hum_SHT:hum_SHT
};
}