// ****************** officee *******************************

// m here = minute = 60 * second
// h here = hour   = 60 * minute
// K               = 1000
// KK works as 10^6
// s here = second = 1000


// ******** infrastructure *************

Analog.NBits                 =    12   // 8, 10, 12, or 13
Analog.ReadAveraging         =     1   // 1(1)32
Board.BatteryDivider         =     0.0824
Board.DoInactivityCheck      =     0   // promote singleton
Board.LoggingToUSD           =     0
Board.SendingToBase          =     1   // ******** not checked ***********
Board.msBlinkLength          =   200
Board.msMaxInactivity        =    30s
Board.Name                   =   'office'
Board.Nominal3V3             =     3.304  // for fudging analog read
Board.Tag                    =   'O'
DS1307.msJogDelay            =     6s // ******** not checked ***********
FileSystem.NewFileNameQDay   =     1
XBee.BaseID                  =   200
XBee.BaudRate                = 38400

// ********* sensors ******************

ACDetect_1.InUse       =  0
ACDetect_2.InUse       =  0
BMP085.InUse           =  0
depth.InUse            =  0
DHT22_1.InUse          =  0
DHT22_2.InUse          =  1
lightning.InUse        =  1 
relay_1.InUse          =  0    
resistance_1.InUse     =  0     // light
resistance_2.InUse     =  0
resistance_3.InUse     =  0     // wind direction
SPS30.InUse            =  0     
switch_1.InUse         =  0     // wind speed
switch_2.InUse         =  0     // rain
VC0706.InUse           =  0
voltage_1.InUse        =  0     
voltage_2.InUse        =  0

ACDetect_2.SensorTag   =  'A'
BMP085.SensorTag       =  'B'
DHT22_2.SensorTag      =  'D'
depth.SensorTag        =  'd'
DHT22_1.SensorTag      =  'E'
ACDetect_1.SensorTag   =  'F'
resistance_1.SensorTag =  'L'
voltage_1.SensorTag    =  'P'
voltage_2.SensorTag    =  'p'
switch_2.SensorTag     =  'R'
SPS30.SensorTag        =  'S'
relay_1.SensorTag      =  'T'
switch_1.SensorTag     =  'W'
resistance_3.SensorTag =  'w'
lightning.SensorTag    =  'Z'

// --- DHT22

DHT22_2.Damping                      =    0.9
DHT22_2.Observed                     =  'office'
DHT22_2.MaxTempC                     =   50
DHT22_2.MinTempC                     =  -40
DHT22_2.usNominalReadInterval        =   10mK
DHT22_2.ReportRH                     =    1
DHT22_2.Singleton                    =    1

// --- lightning detector, see https://www.digikey.ca/en/articles/incoming-storm-a-lightning-detector-from-ams

Lightning.FlashesNeeded              =    1   // REG0x02[5:4]: 1, 5, 9, 16 
Lightning.MaskDisturbance            =    0   // REG0x03[5:5]: 1 to ignore disturbances
Lightning.NoiseFloor                 =    1   // REG0x01[6:4]: 1 2*..  7 (reduce for sensitivity)
Lightning.SpikeThreshold             =    1   // REG0x02[3:0]: 1 2*.. 11 (SREJ, reduce for sensitivity)
Lightning.Threshold                  =    1   // REG0x01[3:0]: 1 2*.. 10 (watchdog, WDTH, reduce for sensitivity)
Lightning.LightningOutdoors          =   18   // REG0x00[5:1]: 14 outdoors, 18 indoors
Lightning.usNominalReadInterval      =    1mK
Lightning.msNominalReportInterval    =    5m
