EasyManuals Logo

Dragino LSN50 User Manual

Dragino LSN50
60 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #19 background imageLoading...
Page #19 background image
www.dragino.com
LSN50 LoRa Sensor Node User Manual 19 / 60
}
else if(bytes[6] & 0x04)
{
var mod2="Distance"; //work mode
}
else if(!(bytes[6] & 0x04))
{
var mod1="IIC"; //work mode
}
if(mod3=="3ADC")
{
var adc_ch0=(bytes[0]<<8 | bytes[1])/1000;//PA0,ADC Channel 0,units:V
var adc_ch1=(bytes[2]<<8 | bytes[3])/1000;//PA1,ADC Channel 1,units:V
var adc_ch4=(bytes[4]<<8 | bytes[5])/1000;//PA4,ADC Channel 4,units:V
var switch_=(bytes[6] & 0x80)? "CLOSE":"OPEN";//PB14,GPIO_MODE_IT_FALLING
var digital_IS=(bytes[6] & 0x02)? "H":"L";//PA12Digital Input Status
var exti_trigger=(bytes[6] & 0x01)? "TRUE":"FALSE";//PB14,GPIO_MODE_IT_FALLING
value=bytes[7]<<8 | bytes[8];
if(bytes[7] & 0x80)
{value |= 0xFFFF0000;}
var temp_SHT=(value/10).toFixed(2);//SHT20,temperature,units:
value=bytes[9]<<8 | bytes[10];
var hum_SHT=(value/10).toFixed(1);//SHT20,Humidity,units:%
var batV= bytes[11]/10;//Battery,units:V
}
else if((mod1=="IIC")||(mod2=="Distance")||(mod4=="3DS18B20"))
{
var value=bytes[0]<<8 | bytes[1];
batV=value/1000;//Battery,units:V
value=bytes[2]<<8 | bytes[3];
if(bytes[2] & 0x80)
{value |= 0xFFFF0000;}
var tempc1=(value/10).toFixed(2);//DS18B20,PB3,units:
adc_ch0=(bytes[4]<<8 | bytes[5])/1000;//PA0,ADC Channel 0,units:V
switch_=(bytes[6] & 0x80)? "CLOSE":"OPEN";//PB14,GPIO_MODE_IT_FALLING
digital_IS=(bytes[6] & 0x02)? "H":"L";//PA12Digital Input Status
exti_trigger=(bytes[6] & 0x01)? "TRUE":"FALSE";//PB14,GPIO_MODE_IT_FALLING
if(mod1=="IIC")
{
value=bytes[7]<<8 | bytes[8];
if(bytes[7] & 0x80)
{value |= 0xFFFF0000;}
temp_SHT=(value/10).toFixed(2);//SHT20,temperature,units:
value=bytes[9]<<8 | bytes[10];

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Dragino LSN50 and is the answer not in the manual?

Dragino LSN50 Specifications

General IconGeneral
BrandDragino
ModelLSN50
CategoryAccessories
LanguageEnglish

Related product manuals